15 #ifndef MRIMAGE_UTILS_H
16 #define MRIMAGE_UTILS_H
46 std::ostream&
operator<<(std::ostream &out,
const MRImage& img);
79 double sigma,
double spacing = -1);
90 ptr<MRImage>
resample(ptr<const MRImage> in,
double* spacing,
106 ptr<MRImage>
shiftImage(ptr<MRImage> in,
size_t len,
double* vect);
118 void writeComplex(std::string basename, ptr<const MRImage> in,
119 bool absPhase =
false);
132 const std::vector<size_t>& in_osize);
146 const std::vector<size_t>& in_osize);
188 ptr<MRImage>
rigidTransform(ptr<MRImage> in,
double rx,
double ry,
double rz,
189 double sx,
double sy,
double sz);
200 ptr<MRImage>
diffOfGauss(ptr<const MRImage> in,
double sd1,
double sd2);
210 double overlapRatio(ptr<const MRImage> a, ptr<const MRImage> b);
221 ptr<MRImage>
resampleNN(ptr<const MRImage> in, ptr<const MRImage> atlas,
234 ptr<MRImage>
resampleNN(ptr<const MRImage> in,
double* newspace,
251 size_t x,
size_t y,
size_t z,
size_t t);
255 #endif //MRIMAGE_UTILS_H
ptr< MRImage > fft_backward(ptr< const MRImage > in, const std::vector< size_t > &in_osize)
Performs inverse FFT transform in N dimensions.
int rotateImageShearFFT(ptr< MRImage > inout, double rx, double ry, double rz, double(*window)(double, double)=npl::sincWindow)
Rotates an image around the center using shear decomposition followed by FFT-based shearing...
int rotateImageShearKern(ptr< MRImage > inout, double rx, double ry, double rz, double(*kern)(double, double)=npl::lanczosKern)
Rotates an image around the center using shear decomposition followed by kernel-based shearing...
ptr< MRImage > fft_forward(ptr< const MRImage > in, const std::vector< size_t > &in_osize)
Performs forward FFT transform in N dimensions.
std::ostream & operator<<(std::ostream &os, const Matrix< D1, D2 > &b)
double sincWindow(double x, double a)
Sinc function centered at 0, with radius a, range should be = 2a.
ptr< MRImage > diffOfGauss(ptr< const MRImage > in, double sd1, double sd2)
Computes difference of gaussians.
ptr< MRImage > resampleNN(ptr< const MRImage > in, ptr< const MRImage > atlas, PixelT type=UNKNOWN_TYPE)
Performs nearest neighbor resasmpling of input to atlas.
double hannWindow(double x, double a)
ptr< MRImage > resample(ptr< const MRImage > in, double *spacing, double(*window)(double, double)=hannWindow)
Performs fourier resampling using fourier transform and the provided window function.
void gaussianSmooth1D(ptr< MRImage > inout, size_t dim, double stddev)
Gaussian smooths an image in 1 direction. Questionable whether it works. Seems to shift image...
ptr< MRImage > rigidTransform(ptr< MRImage > in, double rx, double ry, double rz, double sx, double sy, double sz)
Rigid Transforms an image.
ptr< MRImage > randImage(PixelT type, double mean, double sd, size_t x, size_t y, size_t z, size_t t)
Create random image, with gaussian distribution.
ptr< MRImage > shiftImage(ptr< MRImage > in, size_t len, double *vect)
Uses fourier shift theorem to shift an image.
ptr< MRImage > smoothDownsample(ptr< const MRImage > in, double sigma, double spacing=-1)
Performs smoothing in each dimension, then downsamples so that pixel spacing is roughly equal to FWHM...
double lanczosKern(double x, double a)
Derivative of lanczos kernel with respect to x.
void writeComplex(std::string basename, ptr< const MRImage > in, bool absPhase=false)
Writes a pair of images, one real, one imaginary or if absPhase is set to true then an absolute image...
double overlapRatio(ptr< const MRImage > a, ptr< const MRImage > b)
Computes the overlap of the two images' in 3-space.