16 #include "libmesh/bounding_box.h" 17 #include "libmesh/mesh_base.h" 20 #ifdef LIBMESH_HAVE_VTK 24 #include "libmesh/ignore_warnings.h" 33 #ifndef MOOSE_VTK_UNDEF_NLOHMANNJSON_HEADER_GUARDS 34 #define MOOSE_VTK_UNDEF_NLOHMANNJSON_HEADER_GUARDS 0 37 #if __has_include("vtk_nlohmannjson.h") 38 #include "vtk_nlohmannjson.h" 39 #if !VTK_MODULE_USE_EXTERNAL_vtknlohmannjson 40 #undef MOOSE_VTK_UNDEF_NLOHMANNJSON_HEADER_GUARDS 41 #define MOOSE_VTK_UNDEF_NLOHMANNJSON_HEADER_GUARDS 1 42 #endif // !VTK_MODULE_USE_EXTERNAL_vtknlohmannjson 43 #endif // __has_include("vtk_nlohmannjson.h") 44 #else // __has_include 45 #error "Could not auto-detect whether VTK built with external nlohmann json. \ 46 Define MOOSE_VTK_UNDEF_NLOHMANNJSON_HEADER_GUARDS=1 if built with vendored nlohmann \ 47 , otherwise define MOOSE_VTK_UNDEF_NLOHMANNJSON_HEADER_GUARDS=0" 48 #endif // __has_include 49 #endif // MOOSE_VTK_UNDEF_NLOHMANNJSON_HEADER_GUARDS 51 #if MOOSE_VTK_UNDEF_NLOHMANNJSON_HEADER_GUARDS && !defined(MOOSE_VTK_NLOHMANN_INCLUDED) 52 #undef INCLUDE_NLOHMANN_JSON_FWD_HPP_ 53 #define MOOSE_VTK_NLOHMANN_INCLUDED 56 #include "vtkSmartPointer.h" 57 #include "vtkPNGReader.h" 58 #include "vtkTIFFReader.h" 59 #include "vtkImageData.h" 60 #include "vtkStringArray.h" 61 #include "vtkImageThreshold.h" 62 #include "vtkImageNormalize.h" 63 #include "vtkImageCast.h" 64 #include "vtkImageShiftScale.h" 65 #include "vtkImageMagnitude.h" 66 #include "vtkImageFlip.h" 74 #include "libmesh/restore_warnings.h" 133 #ifdef LIBMESH_HAVE_VTK 165 #ifdef LIBMESH_HAVE_VTK 166 vtkSmartPointer<vtkImageFlip>
imageFlip(
const int & axis);
182 #ifdef LIBMESH_HAVE_VTK vtkSmartPointer< vtkImageMagnitude > _magnitude_filter
Pointer to the magnitude filter.
A helper class for re-directing output streams to Console output objects form MooseObjects.
void vtkMagnitude()
Convert the image to greyscale.
std::vector< int > _dims
Pixel dimension of image.
virtual libMesh::Real sample(const libMesh::Point &p)
Return the pixel value for the given point.
vtkSmartPointer< vtkImageFlip > imageFlip(const int &axis)
Helper method for flipping image.
vtkAlgorithmOutput * _algorithm
VTK-6 seems to work better in terms of "algorithm outputs" rather than vtkImageData pointers...
const InputParameters & _is_pars
Parameters for interface.
virtual void setupImageSampler(libMesh::MeshBase &mesh)
Perform initialization of image data.
libMesh::Point _physical_dims
Physical dimensions of image.
static InputParameters validParams()
Constructor.
MeshBaseImageSampler(const InputParameters ¶meters)
vtkSmartPointer< vtkImageFlip > _flip_filter
Pointers to image flipping filter. May be used for x, y, or z.
libMesh::BoundingBox _bounding_box
Bounding box for testing points.
unsigned int _component
Component to extract.
A helper class for reading and sampling images using VTK, but with a Meshbase object.
vtkSmartPointer< vtkStringArray > _files
List of file names to extract data.
To be called in the validParams functions of classes that need to operate on ranges of files...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
vtkImageData * _data
Complete image data.
vtkSmartPointer< vtkImageShiftScale > _shift_scale_filter
Pointer to the shift and scaling filter.
vtkSmartPointer< vtkImageThreshold > _image_threshold
Pointer to thresholding filter.
std::vector< double > _voxel
Physical pixel size.
void vtkFlip()
Perform image flipping.
libMesh::Point _origin
Origin of image.
void vtkThreshold()
Perform thresholding.
vtkSmartPointer< vtkImageReader2 > _image
Complete image data.
ConsoleStream _is_console
Create a console stream object for this helper class.
void vtkShiftAndScale()
Apply image re-scaling using the vtkImageShiftAndRescale object.