Medical Imaging Interaction Toolkit  2023.04.00
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 ()
 
 ~mitkVtkImageOverwrite () override
 
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 51 of file mitkVtkImageOverwrite.h.

Constructor & Destructor Documentation

◆ mitkVtkImageOverwrite()

mitkVtkImageOverwrite::mitkVtkImageOverwrite ( )
protected

◆ ~mitkVtkImageOverwrite()

mitkVtkImageOverwrite::~mitkVtkImageOverwrite ( )
overrideprotected

Member Function Documentation

◆ IsOverwriteMode()

bool mitkVtkImageOverwrite::IsOverwriteMode ( )
inline

Definition at line 61 of file mitkVtkImageOverwrite.h.

◆ New()

static mitkVtkImageOverwrite* mitkVtkImageOverwrite::New ( )
static

◆ SetInputSlice()

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!

◆ SetOverwriteMode()

void mitkVtkImageOverwrite::SetOverwriteMode ( bool  b)

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

◆ ThreadedRequestData()

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

Overridden from vtkImageReslice.

See also
vtkImageReslice::ThreadedRequestData

◆ vtkTypeMacro()

mitkVtkImageOverwrite::vtkTypeMacro ( mitkVtkImageOverwrite  ,
vtkImageReslice   
)

Member Data Documentation

◆ m_Overwrite_Mode

bool mitkVtkImageOverwrite::m_Overwrite_Mode
protected

Definition at line 72 of file mitkVtkImageOverwrite.h.


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