Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
ExtractSliceFilter extracts a 2D abitrary oriented slice from a 3D volume. More...
#include <mitkExtractSliceFilter.h>
Public Member Functions | |
virtual std::vector< std::string > | GetClassHierarchy () const override |
virtual const char * | GetClassName () const |
Pointer | Clone () const |
void | SetWorldGeometry (const PlaneGeometry *geometry) |
Set the axis where to reslice at. More... | |
void | SetTimeStep (unsigned int timestep) |
Set the time step in the 4D volume. More... | |
unsigned int | GetTimeStep () |
void | SetComponent (unsigned int component) |
Set the component of an image to be extracted. More... | |
void | SetResliceTransformByGeometry (const BaseGeometry *transform) |
Set a transform for the reslice axes. This transform is needed if the image volume itself is transformed. (Effects the reslice axis) More... | |
void | SetInPlaneResampleExtentByGeometry (bool inPlaneResampleExtentByGeometry) |
Resampling grid corresponds to: false->image true->worldgeometry. More... | |
void | SetOutputDimensionality (unsigned int dimension) |
Sets the output dimension of the slice. More... | |
void | SetOutputSpacingZDirection (double zSpacing) |
Set the spacing in z direction manually. Required if the outputDimension is > 2. More... | |
void | SetOutputExtentZDirection (int zMin, int zMax) |
Set the extent in pixel for direction z manualy. Required if the output dimension is > 2. More... | |
bool | GetClippedPlaneBounds (double bounds[6]) |
Get the bounding box of the slice [xMin, xMax, yMin, yMax, zMin, zMax] The method uses the input of the filter to calculate the bounds. It is recommended to use GetClippedPlaneBounds(const BaseGeometry*, const PlaneGeometry*, double*) if you are not sure about the input. More... | |
bool | GetClippedPlaneBounds (const BaseGeometry *boundingGeometry, const PlaneGeometry *planeGeometry, double *bounds) |
Get the bounding box of the slice [xMin, xMax, yMin, yMax, zMin, zMax]. More... | |
mitk::ScalarType * | GetOutputSpacing () |
Get the spacing of the slice. returns mitk::ScalarType[2]. More... | |
vtkImageData * | GetVtkOutput () |
Get Output as vtkImageData. Note: SetVtkOutputRequest(true) has to be called at least once before GetVtkOutput(). Otherwise the output is empty for the first update step. More... | |
void | SetVtkOutputRequest (bool isRequested) |
vtkMatrix4x4 * | GetResliceAxes () |
Get the reslices axis matrix. Note: the axis are recalculated when calling SetResliceTransformByGeometry. More... | |
void | SetBackgroundLevel (double backgroundLevel) |
void | SetInterpolationMode (ExtractSliceFilter::ResliceInterpolation interpolation) |
![]() | |
Pointer | Clone () const |
virtual void | SetInput (const InputImageType *image) |
virtual void | SetInput (unsigned int, const InputImageType *image) |
InputImageType * | GetInput (void) |
InputImageType * | GetInput (unsigned int idx) |
const InputImageType * | GetInput (void) const |
const InputImageType * | GetInput (unsigned int idx) const |
![]() | |
Pointer | Clone () const |
OutputType * | GetOutput () |
Get the output data of this image source object. More... | |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (DataObjectPointerArraySizeType idx) const |
itk::DataObject::Pointer | MakeOutput (DataObjectPointerArraySizeType idx) override |
Make a DataObject of the correct type to used as the specified output. More... | |
itk::DataObject::Pointer | MakeOutput (const DataObjectIdentifierType &name) override |
virtual vtkImageData * | GetVtkImageData () |
virtual const vtkImageData * | GetVtkImageData () const |
![]() | |
OutputType * | GetOutput () |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (DataObjectPointerArraySizeType idx) const |
virtual void | GraftOutput (OutputType *output) |
Graft the specified BaseData onto this BaseDataSource's output. More... | |
virtual void | GraftOutput (const DataObjectIdentifierType &key, OutputType *output) |
virtual void | GraftNthOutput (unsigned int idx, OutputType *output) |
Graft the specified base data object onto this BaseDataSource's idx'th output. More... | |
bool | Updating () const |
Access itk::ProcessObject::m_Updating. More... | |
Static Public Member Functions | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
static Pointer | New (vtkImageReslice *_arg) |
![]() | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
![]() | |
static const char * | GetStaticNameOfClass () |
static Pointer | New () |
Method for creation through the object factory. More... | |
![]() | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
ExtractSliceFilter (vtkImageReslice *reslicer=nullptr) | |
~ExtractSliceFilter () override | |
void | GenerateData () override |
void | GenerateOutputInformation () override |
void | GenerateInputRequestedRegion () override |
![]() | |
ImageToImageFilter () | |
~ImageToImageFilter () override | |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
void | GenerateInputRequestedRegion () override |
![]() | |
ImageSource () | |
~ImageSource () override | |
void | GenerateData () override |
A version of GenerateData() specific for image processing filters. More... | |
virtual void | ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId) |
If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). More... | |
void | PrepareOutputs () override |
This method is intentionally left blank. More... | |
virtual void | AllocateOutputs () |
The GenerateData method normally allocates the buffers for all of the outputs of a filter. More... | |
virtual void | BeforeThreadedGenerateData () |
If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). More... | |
virtual void | AfterThreadedGenerateData () |
If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). More... | |
virtual unsigned int | SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion) |
Split the output's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". More... | |
![]() | |
BaseDataSource () | |
~BaseDataSource () override | |
Protected Attributes | |
const PlaneGeometry * | m_WorldGeometry |
vtkSmartPointer< vtkImageReslice > | m_Reslicer |
unsigned int | m_TimeStep |
unsigned int | m_OutputDimension |
double | m_ZSpacing |
int | m_ZMin |
int | m_ZMax |
ResliceInterpolation | m_InterpolationMode |
bool | m_InPlaneResampleExtentByGeometry |
mitk::ScalarType * | m_OutPutSpacing |
bool | m_VtkOutputRequested |
double | m_BackgroundLevel |
unsigned int | m_Component |
Additional Inherited Members | |
![]() | |
static ITK_THREAD_RETURN_TYPE | ThreaderCallback (void *arg) |
Static function used as a "callback" by the MultiThreader. More... | |
![]() | |
static Pointer | New () |
ExtractSliceFilter extracts a 2D abitrary oriented slice from a 3D volume.
The filter can reslice in all orthogonal planes such as sagittal, coronal and axial, and is also able to reslice an arbitrary oriented oblique plane. Curved planes are specified via an AbstractTransformGeometry as the input worldgeometry.
Additionally the filter extracts the specified component of a multi-component input image. This is done only if the caller requests an mitk::Image output ('m_VtkOutputRequested' set to false). The default component to be extracted is '0'.
The convenient workflow is:
There are a few more properties that can be set to modify the behavior of the slicing. The properties are:
By default the properties are set to:
Definition at line 63 of file mitkExtractSliceFilter.h.
typedef itk::SmartPointer<const Self> mitk::ExtractSliceFilter::ConstPointer |
Definition at line 66 of file mitkExtractSliceFilter.h.
Definition at line 66 of file mitkExtractSliceFilter.h.
Definition at line 66 of file mitkExtractSliceFilter.h.
Definition at line 66 of file mitkExtractSliceFilter.h.
Enumerator | |
---|---|
RESLICE_NEAREST | |
RESLICE_LINEAR | |
RESLICE_CUBIC |
Definition at line 150 of file mitkExtractSliceFilter.h.
|
protected |
Definition at line 24 of file mitkExtractSliceFilter.cpp.
References m_BackgroundLevel, m_Component, m_InPlaneResampleExtentByGeometry, m_InterpolationMode, m_OutputDimension, m_OutPutSpacing, m_Reslicer, m_TimeStep, m_VtkOutputRequested, m_ZMax, m_ZMin, m_ZSpacing, and RESLICE_NEAREST.
|
overrideprotected |
Definition at line 50 of file mitkExtractSliceFilter.cpp.
References m_OutPutSpacing, and m_WorldGeometry.
Pointer mitk::ExtractSliceFilter::Clone | ( | ) | const |
|
overrideprotected |
Definition at line 243 of file mitkExtractSliceFilter.cpp.
References mitk::TimeGeometry::CountTimeSteps(), mitk::TimeGeometry::GetGeometryForTimeStep(), mitk::ImageToImageFilter::GetInput(), mitk::ImageSource::GetOutput(), mitk::BaseData::GetTimeGeometry(), mitk::Image::GetVtkImageData(), mitk::TimeGeometry::IsValidTimeStep(), mitk::Image::IsVolumeSet(), mitk::itk2vtk(), m_BackgroundLevel, m_Component, m_InterpolationMode, m_OutputDimension, m_OutPutSpacing, m_Reslicer, m_TimeStep, m_VtkOutputRequested, m_WorldGeometry, m_ZMax, m_ZMin, m_ZSpacing, max(), MITK_ERROR, RESLICE_CUBIC, RESLICE_LINEAR, RESLICE_NEAREST, and mitk::vnl2vtk().
|
overrideprotected |
Definition at line 227 of file mitkExtractSliceFilter.cpp.
References mitk::ImageToImageFilter::GetInput().
|
overrideprotected |
Definition at line 57 of file mitkExtractSliceFilter.cpp.
References mitk::PlaneGeometry::Clone(), mitk::TimeGeometry::CountTimeSteps(), GetClippedPlaneBounds(), mitk::BaseGeometry::GetExtent(), mitk::BaseGeometry::GetExtentInMM(), mitk::TimeGeometry::GetGeometryForTimeStep(), mitk::BaseGeometry::GetIndexToWorldTransform(), mitk::ImageToImageFilter::GetInput(), mitk::ImageSource::GetOutput(), mitk::PlaneGeometry::GetReferenceGeometry(), m_InPlaneResampleExtentByGeometry, m_OutPutSpacing, m_TimeStep, m_WorldGeometry, and mitkThrow.
|
inlineoverridevirtual |
Reimplemented from mitk::ImageToImageFilter.
Definition at line 66 of file mitkExtractSliceFilter.h.
|
virtual |
Reimplemented from mitk::ImageToImageFilter.
bool mitk::ExtractSliceFilter::GetClippedPlaneBounds | ( | double | bounds[6] | ) |
Get the bounding box of the slice [xMin, xMax, yMin, yMax, zMin, zMax] The method uses the input of the filter to calculate the bounds. It is recommended to use GetClippedPlaneBounds(const BaseGeometry*, const PlaneGeometry*, double*) if you are not sure about the input.
Definition at line 498 of file mitkExtractSliceFilter.cpp.
References mitk::ImageToImageFilter::GetInput(), mitk::PlaneGeometry::GetReferenceGeometry(), and m_WorldGeometry.
Referenced by GenerateOutputInformation().
bool mitk::ExtractSliceFilter::GetClippedPlaneBounds | ( | const BaseGeometry * | boundingGeometry, |
const PlaneGeometry * | planeGeometry, | ||
double * | bounds | ||
) |
Get the bounding box of the slice [xMin, xMax, yMin, yMax, zMin, zMax].
Definition at line 507 of file mitkExtractSliceFilter.cpp.
References mitk::PlaneClipping::CalculateClippedPlaneBounds().
mitk::ScalarType * mitk::ExtractSliceFilter::GetOutputSpacing | ( | ) |
Get the spacing of the slice. returns mitk::ScalarType[2].
Definition at line 238 of file mitkExtractSliceFilter.cpp.
References m_OutPutSpacing.
|
inline |
Get the reslices axis matrix. Note: the axis are recalculated when calling SetResliceTransformByGeometry.
Definition at line 148 of file mitkExtractSliceFilter.h.
|
inlinestatic |
Definition at line 66 of file mitkExtractSliceFilter.h.
|
inline |
Definition at line 81 of file mitkExtractSliceFilter.h.
|
inline |
Get Output as vtkImageData. Note: SetVtkOutputRequest(true) has to be called at least once before GetVtkOutput(). Otherwise the output is empty for the first update step.
Definition at line 132 of file mitkExtractSliceFilter.h.
|
static |
Referenced by QmitkSliceBasedInterpolatorWidget::AcceptAllInterpolations(), QmitkSlicesInterpolator::AcceptAllInterpolations(), mitk::DiffSliceOperationApplier::ExecuteOperation(), mitk::ContourModelSetToImageFilter::GenerateData(), mitk::LabelSetImageVtkMapper2D::GenerateDataForRenderer(), mitk::SegTool2D::GetAffectedImageSliceAs2DImage(), QmitkSemanticRelationsUIHelper::GetPixmapFromImageNode(), GetPixmapFromImageNode(), QmitkSliceBasedInterpolatorWidget::GetWorkingSlice(), mitk::SliceBasedInterpolationController::Interpolate(), mitk::SegmentationInterpolationController::Interpolate(), mitk::RegEvaluationMapper2D::LocalStorage::LocalStorage(), mitk::ImageVtkMapper2D::LocalStorage::LocalStorage(), mitk::DoseImageVtkMapper2D::LocalStorage::LocalStorage(), mitkRotatedSlice4DTest(), QmitkSliceBasedInterpolatorWidget::OnAcceptInterpolationClicked(), QmitkSlicesInterpolator::OnAcceptInterpolationClicked(), and mitk::SegTool2D::WriteSliceToVolume().
|
inlinestatic |
Definition at line 70 of file mitkExtractSliceFilter.h.
|
inline |
Definition at line 149 of file mitkExtractSliceFilter.h.
|
inline |
Set the component of an image to be extracted.
Definition at line 84 of file mitkExtractSliceFilter.h.
|
inline |
Resampling grid corresponds to: false->image true->worldgeometry.
Definition at line 91 of file mitkExtractSliceFilter.h.
|
inline |
Definition at line 157 of file mitkExtractSliceFilter.h.
|
inline |
Sets the output dimension of the slice.
Definition at line 97 of file mitkExtractSliceFilter.h.
|
inline |
Set the extent in pixel for direction z manualy. Required if the output dimension is > 2.
Definition at line 105 of file mitkExtractSliceFilter.h.
|
inline |
Set the spacing in z direction manually. Required if the outputDimension is > 2.
Definition at line 101 of file mitkExtractSliceFilter.h.
|
inline |
Set a transform for the reslice axes. This transform is needed if the image volume itself is transformed. (Effects the reslice axis)
Definition at line 89 of file mitkExtractSliceFilter.h.
|
inline |
Set the time step in the 4D volume.
Definition at line 80 of file mitkExtractSliceFilter.h.
|
inline |
Set VtkOutPutRequest to suppress the convertion of the image. It is suggested to use this with GetVtkOutput(). Note: SetVtkOutputRequest(true) has to be called at least once before GetVtkOutput(). Otherwise the output is empty for the first update step.
Definition at line 144 of file mitkExtractSliceFilter.h.
|
inline |
Set the axis where to reslice at.
Definition at line 73 of file mitkExtractSliceFilter.h.
|
protected |
Definition at line 191 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateData().
|
protected |
Definition at line 193 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateData().
|
protected |
Definition at line 185 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateOutputInformation().
|
protected |
Definition at line 183 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateData().
|
protected |
Definition at line 175 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateData().
|
protected |
Definition at line 187 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), GenerateData(), GenerateOutputInformation(), GetOutputSpacing(), and ~ExtractSliceFilter().
|
protected |
Definition at line 171 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateData().
|
protected |
Definition at line 173 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), GenerateData(), and GenerateOutputInformation().
|
protected |
Definition at line 189 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateData().
|
protected |
Definition at line 170 of file mitkExtractSliceFilter.h.
Referenced by GenerateData(), GenerateOutputInformation(), GetClippedPlaneBounds(), and ~ExtractSliceFilter().
|
protected |
Definition at line 181 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateData().
|
protected |
Definition at line 179 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateData().
|
protected |
Definition at line 177 of file mitkExtractSliceFilter.h.
Referenced by ExtractSliceFilter(), and GenerateData().