A helper class for reading and sampling images using VTK. More...
#include <ImageSampler.h>
Public Member Functions | |
ImageSampler (const InputParameters ¶meters) | |
virtual libMesh::Real | sample (const libMesh::Point &p) const |
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 () |
Static Public Member Functions | |
static InputParameters | validParams () |
Constructor. More... | |
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 | errorCheck () |
Protected Attributes | |
int | _status |
std::string | _file_suffix |
std::vector< std::string > | _filenames |
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... | |
libMesh::Point | _origin |
Origin of image. More... | |
std::vector< int > | _dims |
Pixel dimension of image. More... | |
libMesh::Point | _physical_dims |
Physical dimensions of image. More... | |
std::vector< double > | _voxel |
Physical pixel size. More... | |
unsigned int | _component |
Component to extract. More... | |
libMesh::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... | |
std::array< bool, 3 > | _flip |
image flip More... | |
A helper class for reading and sampling images using VTK.
Definition at line 83 of file ImageSampler.h.
ImageSampler::ImageSampler | ( | const InputParameters & | parameters | ) |
Definition at line 58 of file ImageSampler.C.
|
protectedinherited |
Definition at line 159 of file FileRangeBuilder.C.
Referenced by ImageMesh::ImageMesh().
|
inlineinherited |
Definition at line 43 of file FileRangeBuilder.h.
Referenced by ImageMeshGenerator::buildMesh3D(), ImageMesh::buildMesh3D(), MeshBaseImageSampler::setupImageSampler(), and setupImageSampler().
|
inlineinherited |
Definition at line 42 of file FileRangeBuilder.h.
Referenced by MeshBaseImageSampler::setupImageSampler(), and setupImageSampler().
|
virtual |
Return the pixel value for the given point.
p | The point at which to extract pixel data |
Definition at line 218 of file ImageSampler.C.
Referenced by ImageFunction::value().
Perform initialization of image data.
Definition at line 80 of file ImageSampler.C.
Referenced by ImageFunction::initialSetup().
|
static |
Constructor.
Use this object as an interface, being sure to also add the parameters to the child class.
Definition at line 20 of file ImageSampler.C.
Referenced by ImageFunction::validParams().
|
protected |
Convert the image to greyscale.
By leaving the 'component' input parameter empty, this is called automatically.
Definition at line 255 of file ImageSampler.C.
Referenced by setupImageSampler().
|
protected |
Apply image re-scaling using the vtkImageShiftAndRescale object.
Definition at line 274 of file ImageSampler.C.
Referenced by setupImageSampler().
|
protected |
Perform thresholding.
Definition at line 301 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 137 of file ImageSampler.h.
Referenced by setupImageSampler(), vtkMagnitude(), vtkShiftAndScale(), and vtkThreshold().
|
private |
Bounding box for testing points.
Definition at line 170 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().
|
private |
Component to extract.
Definition at line 166 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().
|
private |
Complete image data.
Definition at line 134 of file ImageSampler.h.
Referenced by sample(), setupImageSampler(), vtkMagnitude(), vtkShiftAndScale(), and vtkThreshold().
|
private |
Pixel dimension of image.
Definition at line 156 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().
|
protectedinherited |
Definition at line 50 of file FileRangeBuilder.h.
Referenced by FileRangeBuilder::FileRangeBuilder(), and FileRangeBuilder::fileSuffix().
|
protectedinherited |
Definition at line 51 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 131 of file ImageSampler.h.
Referenced by setupImageSampler().
|
private |
|
private |
Complete image data.
Definition at line 140 of file ImageSampler.h.
Referenced by setupImageSampler().
|
private |
Pointer to thresholding filter.
Definition at line 143 of file ImageSampler.h.
Referenced by vtkThreshold().
|
private |
Create a console stream object for this helper class.
Definition at line 176 of file ImageSampler.h.
Referenced by setupImageSampler().
|
private |
Parameters for interface.
Definition at line 173 of file ImageSampler.h.
Referenced by ImageSampler(), setupImageSampler(), vtkMagnitude(), vtkShiftAndScale(), and vtkThreshold().
|
private |
Pointer to the magnitude filter.
Definition at line 149 of file ImageSampler.h.
Referenced by vtkMagnitude().
|
private |
Origin of image.
Definition at line 153 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().
|
private |
Physical dimensions of image.
Definition at line 159 of file ImageSampler.h.
Referenced by setupImageSampler().
|
private |
Pointer to the shift and scaling filter.
Definition at line 146 of file ImageSampler.h.
Referenced by vtkShiftAndScale().
|
protectedinherited |
Definition at line 49 of file FileRangeBuilder.h.
Referenced by FileRangeBuilder::errorCheck(), FileRangeBuilder::FileRangeBuilder(), MeshBaseImageSampler::setupImageSampler(), and setupImageSampler().
|
private |
Physical pixel size.
Definition at line 162 of file ImageSampler.h.
Referenced by sample(), and setupImageSampler().