ImFusion SDK 4.3
ImageDownsampler Class Reference

#include <ImFusion/Base/ImageDownsampler.h>

Manager for image downsampling/upsampling. More...

Detailed Description

Manager for image downsampling/upsampling.

This class should be used when some computations should be executed on an image with a lower resolution. The intended workflow is : OriginalImage -(ImageDownsampler::downsample)-> DownsampledImage -(SomeAlgorithm)-> DownsampledOutput -(ImageDownsampler::upsample)-> Output

If the input image has a mask, the mask will be converted to an ExplicitMask and resampled as well.

Public Types

enum  ResamplingMode {
  MAXDIMENSION , MAXDIMENSION_EQUAL , MAXSIZE , MAXSIZE_EQUAL ,
  MAXSPACING , MINSPACING , SPACING_EQUAL
}
 
enum  ResamplingMethod { NEAREST , LINEAR , HYBRID }
 

Public Member Functions

 ImageDownsampler (const vec3 &originalSpacing, ResamplingMode mode, double resamplingParameter, ResamplingMethod method)
 
void downsample (const SharedImage *inIm, SharedImage *&outIm, bool labelMode=false, bool zeroMask=false)
 
void downsample (const SharedImageSet *inIm, SharedImageSet *&outIm, bool labelMode=false, bool zeroMask=false)
 
void upsample (const SharedImage *inIm, SharedImage *&outIm, bool labelMode=false, bool zeroMask=false)
 
void upsample (const SharedImageSet *inIm, SharedImageSet *&outIm, bool labelMode=false, bool zeroMask=false)
 
bool different (const Image *desc) const
 Returns true if the resulting image dimensions are different and hence processing is necessary.
 

Protected Attributes

vec3 m_originalSpacing
 
ResamplingMode m_mode
 
ResamplingMethod m_method
 
double m_resamplingParam
 
int m_newWidth
 
int m_newHeight
 
int m_newSlices
 
double m_newSpacing [3]
 

Member Enumeration Documentation

◆ ResamplingMode

Enumerator
MAXDIMENSION 

Scales down all dimensions by a common factor such that the maximum dimension is equal to the resampling parameter.

MAXDIMENSION_EQUAL 

Sets all dimensions to be equal to the resampling parameter.

MAXSIZE 

Scales down all dimensions by a common factor such that the total data size is equal to the resampling parameter.

MAXSIZE_EQUAL 

Sets all dimensions to be equal and such that the total data size is equal to the resampling parameter.

MAXSPACING 

Scales down all dimensions by a common factor such that the maximum spacing is equal to the resampling parameter.

MINSPACING 

Scales down all dimensions by a common factor such that the minimum spacing is equal to the resampling parameter.

SPACING_EQUAL 

Sets the spacing of all dimensions to be equal to the resampling parameter.

◆ ResamplingMethod

Enumerator
NEAREST 

Nearest neighbor interpolation.

LINEAR 

Linear interpolation.

HYBRID 

Nearest for downsampling, linear for upsampling.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close