Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

mitk::ManualSegmentationToSurfaceFilter Class Reference
[Process Classes]

Supplies a 3D surface from pre-processed segmentation. More...

#include <mitkManualSegmentationToSurfaceFilter.h>

Inheritance diagram for mitk::ManualSegmentationToSurfaceFilter:
Inheritance graph
[legend]
Collaboration diagram for mitk::ManualSegmentationToSurfaceFilter:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
ManualSegmentationToSurfaceFilter 
Self
typedef ImageToSurfaceFilter Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer
typedef double vtkDouble

Public Member Functions

virtual const char * GetClassName () const
virtual void GenerateData ()
virtual void SetMedianFilter3D (bool _arg)
virtual bool GetMedianFilter3D () const
virtual void MedianFilter3DOn ()
virtual void MedianFilter3DOff ()
virtual void SetInterpolation (bool _arg)
virtual bool GetInterpolation () const
virtual void InterpolationOn ()
virtual void InterpolationOff ()
virtual void SetUseGaussianImageSmooth (bool _arg)
virtual bool GetUseGaussianImageSmooth () const
virtual void UseGaussianImageSmoothOn ()
virtual void UseGaussianImageSmoothOff ()
virtual void SetGaussianStandardDeviation (double _arg)
virtual double GetGaussianStandardDeviation () const
void SetMedianKernelSize (int x, int y, int z)
virtual int GetMedianKernelSizeX () const
virtual int GetMedianKernelSizeY () const
virtual int GetMedianKernelSizeZ () const
void SetInterpolation (vtkDouble x, vtkDouble y, vtkDouble z)

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 ManualSegmentationToSurfaceFilter ()
virtual ~ManualSegmentationToSurfaceFilter ()

Protected Attributes

bool m_MedianFilter3D
int m_MedianKernelSizeX
int m_MedianKernelSizeY
int m_MedianKernelSizeZ
bool m_UseGaussianImageSmooth
double m_GaussianStandardDeviation
bool m_Interpolation
vtkDouble m_InterpolationX
vtkDouble m_InterpolationY
vtkDouble m_InterpolationZ

Detailed Description

Supplies a 3D surface from pre-processed segmentation.

The resulting surface depends on a filter pipeline based on vtkMedian (1) and a Gaussian filter with vtkImageGaussianSmooth (2). All voxel can be changed to an isotropic representation of the image (ATTANTION: the number of voxels in the will change). The resulting isotropic image has 1mm isotropic voxel by default. But can be varied freely.

Definition at line 44 of file mitkManualSegmentationToSurfaceFilter.h.


Member Typedef Documentation

Reimplemented from mitk::ImageToSurfaceFilter.

Definition at line 47 of file mitkManualSegmentationToSurfaceFilter.h.

Reimplemented from mitk::ImageToSurfaceFilter.

Definition at line 47 of file mitkManualSegmentationToSurfaceFilter.h.

Reimplemented from mitk::ImageToSurfaceFilter.

Definition at line 47 of file mitkManualSegmentationToSurfaceFilter.h.

Reimplemented from mitk::ImageToSurfaceFilter.

Definition at line 47 of file mitkManualSegmentationToSurfaceFilter.h.

Definition at line 47 of file mitkManualSegmentationToSurfaceFilter.h.


Constructor & Destructor Documentation

mitk::ManualSegmentationToSurfaceFilter::ManualSegmentationToSurfaceFilter (  ) [protected]
mitk::ManualSegmentationToSurfaceFilter::~ManualSegmentationToSurfaceFilter (  ) [protected, virtual]

Definition at line 39 of file mitkManualSegmentationToSurfaceFilter.cpp.

{};

Member Function Documentation

void mitk::ManualSegmentationToSurfaceFilter::GenerateData (  ) [virtual]

Will pre-process a segmentation voxelwise. The segmentation can use a hole fill relating a median filter and smooth by a Gaussian filter. The image can be interpolated to an isotropic image. By default every filter is disabled. This method calls CreateSurface from mitkImageToSurfaceFilter and does not need a manual call since we use Update().

Reimplemented from mitk::ImageToSurfaceFilter.

Definition at line 41 of file mitkManualSegmentationToSurfaceFilter.cpp.

References mitk::ProgressBar::AddStepsToDo(), mitk::ProgressBar::GetInstance(), mitk::SlicedData::GetRequestedRegion(), mitk::Image::GetVtkImageData(), QuadProgPP::median(), MITK_INFO, mitk::ProgressBar::Progress(), and QuadProgPP::t().

{
  mitk::Surface *surface = this->GetOutput();
  mitk::Image * image    =  (mitk::Image*)GetInput();
  mitk::Image::RegionType outputRegion = image->GetRequestedRegion();

  int tstart=outputRegion.GetIndex(3);
  int tmax=tstart+outputRegion.GetSize(3); //GetSize()==1 - will aber 0 haben, wenn nicht zeitaufgeloest

  ScalarType thresholdExpanded = this->m_Threshold;

  if ((tmax-tstart) > 0)
  {
    ProgressBar::GetInstance()->AddStepsToDo( 7 * (tmax - tstart)  );
  }

  for( int t=tstart; t<tmax; t++ )
  {

    vtkSmartPointer<vtkImageData> vtkimage = image->GetVtkImageData(t);

    // Median -->smooth 3D 
    MITK_INFO << (m_MedianFilter3D ? "Applying median..." : "No median filtering");
    if(m_MedianFilter3D)
    {
      vtkImageMedian3D *median = vtkImageMedian3D::New();
      median->SetInput(vtkimage); //RC++ (VTK < 5.0)
      median->SetKernelSize(m_MedianKernelSizeX,m_MedianKernelSizeY,m_MedianKernelSizeZ);//Std: 3x3x3
      median->ReleaseDataFlagOn();
      median->UpdateInformation();
      median->Update();
      vtkimage = median->GetOutput(); //->Out
      median->Delete();
    }
    ProgressBar::GetInstance()->Progress();

    //Interpolate image spacing 
    MITK_INFO << (m_Interpolation ? "Resampling..." : "No resampling");
    if(m_Interpolation)
    {
      vtkImageResample * imageresample = vtkImageResample::New();
      imageresample->SetInput(vtkimage);

      //Set Spacing Manual to 1mm in each direction (Original spacing is lost during image processing)      
      imageresample->SetAxisOutputSpacing(0, m_InterpolationX);
      imageresample->SetAxisOutputSpacing(1, m_InterpolationY);
      imageresample->SetAxisOutputSpacing(2, m_InterpolationZ);
      imageresample->UpdateInformation();
      imageresample->Update();
      vtkimage=imageresample->GetOutput();//->Output
      imageresample->Delete();
    }
    ProgressBar::GetInstance()->Progress();

    MITK_INFO << (m_UseGaussianImageSmooth ? "Applying gaussian smoothing..." : "No gaussian smoothing");
    if(m_UseGaussianImageSmooth)//gauss
    {
      vtkImageThreshold* vtkimagethreshold = vtkImageThreshold::New();
      vtkimagethreshold->SetInput(vtkimage);
      vtkimagethreshold->SetInValue( 100 );
      vtkimagethreshold->SetOutValue( 0 );
      vtkimagethreshold->ThresholdByUpper( this->m_Threshold ); 
      thresholdExpanded = 49;

      vtkimagethreshold->SetOutputScalarTypeToUnsignedChar();
      vtkimagethreshold->ReleaseDataFlagOn();

      vtkImageGaussianSmooth *gaussian = vtkImageGaussianSmooth::New();
      gaussian->SetInput(vtkimagethreshold->GetOutput()); 
      gaussian->SetDimensionality(3);
      gaussian->SetRadiusFactor(0.49);
      gaussian->SetStandardDeviation( m_GaussianStandardDeviation );
      gaussian->ReleaseDataFlagOn();
      gaussian->UpdateInformation();
      gaussian->Update();
      vtkimage = gaussian->GetOutput(); //->Out
      gaussian->Delete();
      vtkimagethreshold->Delete();
    }
    ProgressBar::GetInstance()->Progress();

    // Create sureface for t-Slice
    CreateSurface(t, vtkimage, surface, thresholdExpanded);
    ProgressBar::GetInstance()->Progress();
  }
};
virtual const char* mitk::ManualSegmentationToSurfaceFilter::GetClassName (  ) const [virtual]

Reimplemented from mitk::ImageToSurfaceFilter.

virtual double mitk::ManualSegmentationToSurfaceFilter::GetGaussianStandardDeviation (  ) const [virtual]

Returns the standard deviation of the Gaussian filter which will be used when filter is enabled.

virtual bool mitk::ManualSegmentationToSurfaceFilter::GetInterpolation (  ) const [virtual]

Returns activation state of interpolation filter.

virtual bool mitk::ManualSegmentationToSurfaceFilter::GetMedianFilter3D (  ) const [virtual]

Return state if median filter is enabled.

virtual int mitk::ManualSegmentationToSurfaceFilter::GetMedianKernelSizeX (  ) const [virtual]

Returns the kernel size in the first direction.

virtual int mitk::ManualSegmentationToSurfaceFilter::GetMedianKernelSizeY (  ) const [virtual]

Returns the kernel size in the second direction.

virtual int mitk::ManualSegmentationToSurfaceFilter::GetMedianKernelSizeZ (  ) const [virtual]

Returns the kernel size in the third direction.

virtual bool mitk::ManualSegmentationToSurfaceFilter::GetUseGaussianImageSmooth (  ) const [virtual]

Returns activation state of standard deviation filter.

virtual void mitk::ManualSegmentationToSurfaceFilter::InterpolationOff (  ) [virtual]
virtual void mitk::ManualSegmentationToSurfaceFilter::InterpolationOn (  ) [virtual]

Enable the interpolation filter (second filter in pipeline) for isotropic voxel.

virtual void mitk::ManualSegmentationToSurfaceFilter::MedianFilter3DOff (  ) [virtual]
virtual void mitk::ManualSegmentationToSurfaceFilter::MedianFilter3DOn (  ) [virtual]

Enable the median filter (first filter in pipeline).

static Pointer mitk::ManualSegmentationToSurfaceFilter::New (  ) [static]
virtual void mitk::ManualSegmentationToSurfaceFilter::SetGaussianStandardDeviation ( double  _arg ) [virtual]

Set standard deviation for Gaussian Filter.

Parameters:
_argby default 1.5
virtual void mitk::ManualSegmentationToSurfaceFilter::SetInterpolation ( bool  _arg ) [virtual]

Supplies a method to enable Interpolation.

void mitk::ManualSegmentationToSurfaceFilter::SetInterpolation ( vtkDouble  x,
vtkDouble  y,
vtkDouble  z 
)

Set the values for Spacing in X, Y and Z-Dimension

Definition at line 136 of file mitkManualSegmentationToSurfaceFilter.cpp.

virtual void mitk::ManualSegmentationToSurfaceFilter::SetMedianFilter3D ( bool  _arg ) [virtual]

Supplies a method for setting median filter by a bool value.

void mitk::ManualSegmentationToSurfaceFilter::SetMedianKernelSize ( int  x,
int  y,
int  z 
)

Set the Kernel for Median3DFilter. By default kernel is set to 3x3x3. If you choose '1' nothing will be processed in this direction.

Definition at line 129 of file mitkManualSegmentationToSurfaceFilter.cpp.

virtual void mitk::ManualSegmentationToSurfaceFilter::SetUseGaussianImageSmooth ( bool  _arg ) [virtual]

Supplies a method for Gaussian filter (third filter in pipeline).

virtual void mitk::ManualSegmentationToSurfaceFilter::UseGaussianImageSmoothOff (  ) [virtual]
virtual void mitk::ManualSegmentationToSurfaceFilter::UseGaussianImageSmoothOn (  ) [virtual]

Enables Gaussian image smooth. As well the threshold for the CreateSurface() method will raise the threshold to 49 and changes the image range set from 0 to 100. It is made for reasons in binary images to prevent conflicts with the used filter. There are better results for dividing fore- and background.


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines