Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkVtkImageOverwrite Class Reference

A vtk Filter based on vtkImageReslice with the aditional feature to write a slice into the given input volume. All optimizations for e.g. the plane directions or interpolation are stripped away, the algorithm only interpolates nearest neighbor and uses the non optimized execute function of vtkImageReslice. Note that any interpolation doesn't make sense for round trip use extract->edit->overwrite, because it is nearly impossible to invert the interolation. There are two use cases for the Filter which are specified by the overwritemode property: More...

#include <mitkVtkImageOverwrite.h>

Inheritance diagram for mitkVtkImageOverwrite:
Collaboration diagram for mitkVtkImageOverwrite:

Public Member Functions

 vtkTypeMacro (mitkVtkImageOverwrite, vtkImageReslice)
 
void SetOverwriteMode (bool b)
 Set the mode either to reslice (false) or to overwrite (true). Default: false. More...
 
bool IsOverwriteMode ()
 
void SetInputSlice (vtkImageData *slice)
 Set the slice for overwrite mode. Note: It is recommend not to use this in reslice mode because otherwise the slice will be modified! More...
 

Static Public Member Functions

static mitkVtkImageOverwriteNew ()
 

Protected Member Functions

 mitkVtkImageOverwrite ()
 
virtual ~mitkVtkImageOverwrite ()
 
virtual void ThreadedRequestData (vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *vtkNotUsed(outputVector), vtkImageData ***inData, vtkImageData **outData, int outExt[6], int id) override
 

Protected Attributes

bool m_Overwrite_Mode
 

Detailed Description

A vtk Filter based on vtkImageReslice with the aditional feature to write a slice into the given input volume. All optimizations for e.g. the plane directions or interpolation are stripped away, the algorithm only interpolates nearest neighbor and uses the non optimized execute function of vtkImageReslice. Note that any interpolation doesn't make sense for round trip use extract->edit->overwrite, because it is nearly impossible to invert the interolation. There are two use cases for the Filter which are specified by the overwritemode property:

1)Extract slices from a 3D volume. Overwritemode = false

In this mode the class can be used like vtkImageReslice. The usual way to do this is:

  • Set an image volume as input
  • Set the ResliceAxes via SetResliceAxesDirectionCosines and SetResliceAxesOrigin
  • Set the the OutputSpacing, OutputOrigin and OutputExtent
  • Call Update

2)Overwrite a 3D volume at a given slice. Overwritemode = true

The handling in this mode is quite similar to the description above with the addition that the InputSlice needs to be specified via SetInputSlice(vtkImageData*).

  • Set the properties mentioned above (Note that SetInput specifies the volume to write to)
  • Set the slice to that has to be overwritten in the volume ( SetInputSlice(vtkImageData*)

After calling Update() there is no need to retrieve the output as the input volume is modified.

See also
vtkImageReslice (Note that the execute and interpolation functions are no members and thus can not be overriden)

Definition at line 55 of file mitkVtkImageOverwrite.h.

Constructor & Destructor Documentation

mitkVtkImageOverwrite::mitkVtkImageOverwrite ( )
protected

Definition at line 110 of file mitkVtkImageOverwrite.cpp.

References m_Overwrite_Mode.

mitkVtkImageOverwrite::~mitkVtkImageOverwrite ( )
protectedvirtual

Definition at line 117 of file mitkVtkImageOverwrite.cpp.

Member Function Documentation

bool mitkVtkImageOverwrite::IsOverwriteMode ( )
inline

Definition at line 65 of file mitkVtkImageOverwrite.h.

static mitkVtkImageOverwrite* mitkVtkImageOverwrite::New ( )
static
void mitkVtkImageOverwrite::SetInputSlice ( vtkImageData *  slice)

Set the slice for overwrite mode. Note: It is recommend not to use this in reslice mode because otherwise the slice will be modified!

Definition at line 837 of file mitkVtkImageOverwrite.cpp.

void mitkVtkImageOverwrite::SetOverwriteMode ( bool  b)

Set the mode either to reslice (false) or to overwrite (true). Default: false.

Definition at line 832 of file mitkVtkImageOverwrite.cpp.

References m_Overwrite_Mode.

void mitkVtkImageOverwrite::ThreadedRequestData ( vtkInformation *  vtkNotUsedrequest,
vtkInformationVector **  vtkNotUsedinputVector,
vtkInformationVector *  vtkNotUsedoutputVector,
vtkImageData ***  inData,
vtkImageData **  outData,
int  outExt[6],
int  id 
)
overrideprotectedvirtual

Overridden from vtkImageReslice.

See also
vtkImageReslice::ThreadedRequestData

Definition at line 846 of file mitkVtkImageOverwrite.cpp.

References vtkImageResliceClearExecute(), and vtkImageResliceExecute().

mitkVtkImageOverwrite::vtkTypeMacro ( mitkVtkImageOverwrite  ,
vtkImageReslice   
)

Member Data Documentation

bool mitkVtkImageOverwrite::m_Overwrite_Mode
protected

Definition at line 76 of file mitkVtkImageOverwrite.h.

Referenced by mitkVtkImageOverwrite(), and SetOverwriteMode().


The documentation for this class was generated from the following files: