A helper class for reading and sampling images using VTK. More...
#include <ImageSampler.h>
Public Member Functions | |
ImageSampler (const InputParameters ¶meters) | |
Constructor. More... | |
virtual Real | sample (const Point &p) |
Return the pixel value for the given point. More... | |
virtual void | setupImageSampler (MooseMesh &mesh) |
Perform initialization of image data. More... | |
std::string | fileSuffix () |
const std::vector< std::string > & | filenames () |
Protected Member Functions | |
void | vtkShiftAndScale () |
Apply image re-scaling using the vtkImageShiftAndRescale object. More... | |
void | vtkThreshold () |
Perform thresholding. More... | |
void | vtkMagnitude () |
Convert the image to greyscale. More... | |
void | vtkFlip () |
Perform image flipping. More... | |
void | errorCheck () |
Protected Attributes | |
int | _status |
std::string | _file_suffix |
std::vector< std::string > | _filenames |
Private Member Functions | |
vtkSmartPointer< vtkImageFlip > | imageFlip (const int &axis) |
Helper method for flipping image. More... | |
Private Attributes | |
vtkSmartPointer< vtkStringArray > | _files |
List of file names to extract data. More... | |
vtkImageData * | _data |
Complete image data. More... | |
vtkAlgorithmOutput * | _algorithm |
VTK-6 seems to work better in terms of "algorithm outputs" rather than vtkImageData pointers... More... | |
vtkSmartPointer< vtkImageReader2 > | _image |
Complete image data. More... | |
vtkSmartPointer< vtkImageThreshold > | _image_threshold |
Pointer to thresholding filter. More... | |
vtkSmartPointer< vtkImageShiftScale > | _shift_scale_filter |
Pointer to the shift and scaling filter. More... | |
vtkSmartPointer< vtkImageMagnitude > | _magnitude_filter |
Pointer to the magnitude filter. More... | |
vtkSmartPointer< vtkImageFlip > | _flip_filter |
Pointers to image flipping filter. May be used for x, y, or z. More... | |
Point | _origin |
Origin of image. More... | |
std::vector< int > | _dims |
Pixel dimension of image. More... | |
Point | _physical_dims |
Physical dimensions of image. More... | |
std::vector< double > | _voxel |
Physical pixel size. More... | |
unsigned int | _component |
Component to extract. More... | |
BoundingBox | _bounding_box |
Bounding box for testing points. More... | |
const InputParameters & | _is_pars |
Parameters for interface. More... | |
ConsoleStream | _is_console |
Create a console stream object for this helper class. More... | |
A helper class for reading and sampling images using VTK.
Definition at line 52 of file ImageSampler.h.
ImageSampler::ImageSampler | ( | const InputParameters & | parameters | ) |
Constructor.
Use this object as an interface, being sure to also add the parameters to the child class.
Definition at line 57 of file ImageSampler.C.
|
protectedinherited |
Definition at line 159 of file FileRangeBuilder.C.
Referenced by ImageMesh::ImageMesh().
|
inlineinherited |
Definition at line 46 of file FileRangeBuilder.h.
Referenced by ImageMeshGenerator::buildMesh3D(), ImageMesh::buildMesh3D(), setupImageSampler(), and MeshBaseImageSampler::setupImageSampler().
|
inlineinherited |
Definition at line 45 of file FileRangeBuilder.h.
Referenced by setupImageSampler(), and MeshBaseImageSampler::setupImageSampler().
|
private |
Helper method for flipping image.
axis | Flag for determing the flip axis: "x=0", "y=1", "z=2" |
Definition at line 355 of file ImageSampler.C.
Referenced by vtkFlip().
|
virtual |
Return the pixel value for the given point.
p | The point at which to extract pixel data |
Definition at line 214 of file ImageSampler.C.
Referenced by ImageSubdomain::modify(), and ImageFunction::value().
|
virtual |
Perform initialization of image data.
Definition at line 75 of file ImageSampler.C.
Referenced by ImageFunction::initialSetup(), and ImageSubdomain::modify().
|
protected |
Perform image flipping.
Flip the image along the x, y, and/or z axis. If multiple flips occur, they happen in order.
Definition at line 332 of file ImageSampler.C.
Referenced by setupImageSampler().
|
protected |
Convert the image to greyscale.
By leaving the 'component' input parameter empty, this is called automatically.
Definition at line 250 of file ImageSampler.C.
Referenced by setupImageSampler().
|
protected |
Apply image re-scaling using the vtkImageShiftAndRescale object.
Definition at line 269 of file ImageSampler.C.
Referenced by setupImageSampler().
|
protected |
Perform thresholding.
Definition at line 296 of file ImageSampler.C.
Referenced by setupImageSampler().
|
private |
VTK-6 seems to work better in terms of "algorithm outputs" rather than vtkImageData pointers...
Definition at line 111 of file ImageSampler.h.
Referenced by imageFlip(), setupImageSampler(), vtkFlip(), vtkMagnitude(), vtkShiftAndScale(), and vtkThreshold().
|
private |
Bounding box for testing points.
Definition at line 156 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().
|
private |
Component to extract.
Definition at line 152 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().
|
private |
Complete image data.
Definition at line 108 of file ImageSampler.h.
Referenced by sample(), setupImageSampler(), vtkFlip(), vtkMagnitude(), vtkShiftAndScale(), and vtkThreshold().
|
private |
Pixel dimension of image.
Definition at line 142 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().
|
protectedinherited |
Definition at line 53 of file FileRangeBuilder.h.
Referenced by FileRangeBuilder::FileRangeBuilder(), and FileRangeBuilder::fileSuffix().
|
protectedinherited |
Definition at line 54 of file FileRangeBuilder.h.
Referenced by ImageMesh::buildMesh(), FileRangeBuilder::filenames(), FileRangeBuilder::FileRangeBuilder(), and ImageMeshGenerator::generate().
|
private |
List of file names to extract data.
Definition at line 105 of file ImageSampler.h.
Referenced by setupImageSampler().
|
private |
Pointers to image flipping filter. May be used for x, y, or z.
Definition at line 126 of file ImageSampler.h.
Referenced by vtkFlip().
|
private |
Complete image data.
Definition at line 114 of file ImageSampler.h.
Referenced by setupImageSampler().
|
private |
Pointer to thresholding filter.
Definition at line 117 of file ImageSampler.h.
Referenced by vtkThreshold().
|
private |
Create a console stream object for this helper class.
Definition at line 162 of file ImageSampler.h.
Referenced by setupImageSampler().
|
private |
Parameters for interface.
Definition at line 159 of file ImageSampler.h.
Referenced by setupImageSampler(), vtkFlip(), vtkMagnitude(), vtkShiftAndScale(), and vtkThreshold().
|
private |
Pointer to the magnitude filter.
Definition at line 123 of file ImageSampler.h.
Referenced by vtkMagnitude().
|
private |
Origin of image.
Definition at line 139 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().
|
private |
Physical dimensions of image.
Definition at line 145 of file ImageSampler.h.
Referenced by setupImageSampler().
|
private |
Pointer to the shift and scaling filter.
Definition at line 120 of file ImageSampler.h.
Referenced by vtkShiftAndScale().
|
protectedinherited |
Definition at line 52 of file FileRangeBuilder.h.
Referenced by FileRangeBuilder::errorCheck(), FileRangeBuilder::FileRangeBuilder(), setupImageSampler(), and MeshBaseImageSampler::setupImageSampler().
|
private |
Physical pixel size.
Definition at line 148 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().