NPL
Neurological Programs and Libraries
mrimage_utils.h File Reference
#include "ndarray.h"
#include "mrimage.h"
#include "basic_functions.h"
#include "npltypes.h"
#include <string>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <memory>

Go to the source code of this file.

Namespaces

 npl
 

Functions

std::ostream & npl::operator<< (std::ostream &out, const MRImage &img)
 Writes out information about an MRImage. More...
 
void npl::gaussianSmooth1D (ptr< MRImage > inout, size_t dim, double stddev)
 Gaussian smooths an image in 1 direction. Questionable whether it works. Seems to shift image. More...
 
ptr< MRImage > npl::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. More...
 
ptr< MRImage > npl::resample (ptr< const MRImage > in, double *spacing, double(*window)(double, double)=hannWindow)
 Performs fourier resampling using fourier transform and the provided window function. More...
 
ptr< MRImage > npl::shiftImage (ptr< MRImage > in, size_t len, double *vect)
 Uses fourier shift theorem to shift an image. More...
 
void npl::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 and a phase image. More...
 
ptr< MRImage > npl::fft_forward (ptr< const MRImage > in, const std::vector< size_t > &in_osize)
 Performs forward FFT transform in N dimensions. More...
 
ptr< MRImage > npl::fft_backward (ptr< const MRImage > in, const std::vector< size_t > &in_osize)
 Performs inverse FFT transform in N dimensions. More...
 
int npl::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. Rotation order is Rz, Ry, Rx, and about the center of the image. This means that 1D interpolation will be used. More...
 
int npl::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. Rotation order is Rz, Ry, Rx, and about the center of the image. More...
 
ptr< MRImage > npl::rigidTransform (ptr< MRImage > in, double rx, double ry, double rz, double sx, double sy, double sz)
 Rigid Transforms an image. More...
 
ptr< MRImage > npl::diffOfGauss (ptr< const MRImage > in, double sd1, double sd2)
 Computes difference of gaussians. More...
 
double npl::overlapRatio (ptr< const MRImage > a, ptr< const MRImage > b)
 Computes the overlap of the two images' in 3-space. More...
 
ptr< MRImage > npl::resampleNN (ptr< const MRImage > in, ptr< const MRImage > atlas, PixelT type=UNKNOWN_TYPE)
 Performs nearest neighbor resasmpling of input to atlas. More...
 
ptr< MRImage > npl::resampleNN (ptr< const MRImage > in, double *newspace, PixelT type=UNKNOWN_TYPE)
 Performs nearest neighbor resasmpling of input to atlas. More...
 
ptr< MRImage > npl::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. More...