Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkVolumeCropFilter Class Reference

mitkVolumeCropFilter - A concrete Filter class to crop a volume More...

#include <mitkVolumeCropFilter.h>

Inherits mitkVolumeToVolumeFilter.

Inheritance diagram for mitkVolumeCropFilter:

Inheritance graph
[legend]
Collaboration diagram for mitkVolumeCropFilter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void PrintSelf (ostream &os)
void SetCropPosition (int xbeginp, int ybeginp, int zbeginp, int xendp, int yendp, int zendp)
void SetCropRegion (int xbeginp, int ybeginp, int zbeginp, int xlength, int ylength, int zlength)

Detailed Description

mitkVolumeCropFilter - A concrete Filter class to crop a volume

mitkVolumeCropFilter is a concrete filter class which inherits from mitkVolumeToVolumeFilter to cut out a given volume. This filter needs a volume input and generates a volume output. So you should first input a volume using public member functin SetInput(), then you should set crop parameters using SetCropPosition(int xbeginp, int ybeginp, int zbeginp, int xendp, int yendp, int zendp), (xbeginp, ybeginp, zbeginp) represents one vertex of the needed crop volume, (xendp, yendp, zendp) represents the diagonal vertexes of the needed crop volume. So you only need to set any pair coordinates of the four diagonal vertexs of the needed crop volume. You can also use SetCropRegion(int xbeginp, int ybeginp, int zbeginp, int xlength, int ylength, int zlength ), (xbeginp, ybeginp, zbeginp) represents one vertex of the needed crop volume, xlength, ylength, zlength represents 3 corresponding lengths from this vertex to the diagonal one. The length can be positive or negative but no zero. Two examples using mitkResizeFilter are given below.
Example 1: If you want to crop volume using SetCropPosition() the code snippet is:

    mitkVolumeCropFilter *filter = new mitkVolumeCropFilter;
    filter->SetInput(inVolume);
    filter->SetCropPosition(xbeginp,ybeginp,zbeginp,xendp,yendp,zendp);
    if (filter->Run())
    {
          mitkVolume *outVolume = filter->GetOutput(); 
          Using  outVolume...
    } 
Example 2: If you want to crop volume using SetCropRegion() the code snippet is:
    mitkResizeFilter *filter = new mitkResizeFilter;
    filter->SetInput(InVolume);
    filter->SetCropRegion(xbeginp,ybeginp,zbeginp,xlength,ylength,zlength);
    if (filter->Run())
    {
        mitkVolume * outVolume = filter->GetOutput();
         Using  outVolume...
    }
Note:
The cropping volume must be valid ,that is, the specified cropping volume must overlap with the original volume.


Member Function Documentation

virtual void mitkVolumeCropFilter::PrintSelf ostream &  os  )  [virtual]
 

Print the necessary information about this object for the debugging purpose.

Parameters:
os The specified ostream to output information.

Reimplemented from mitkVolumeToVolumeFilter.

void mitkVolumeCropFilter::SetCropPosition int  xbeginp,
int  ybeginp,
int  zbeginp,
int  xendp,
int  yendp,
int  zendp
 

Set crop parameters using a pair of diagonal vertexes. The vertex coordinate can be out of the definition area(0 ~ width-1,0 ~ height-1,0 ~ imagenember-1).

Parameters:
xbeginp The x coordinate of one vertex(corresponding to the (x+1) column pixel in width dimension)
ybeginp The y coordinate of one vertex(corresponding to the (y+1) row pixel in height dimension)
zbeginp The z coordinate of one vertex(corresponding to the (z+1) vertical pixel in image number dimension)
xendp The x coordinate of the other vertex(corresponding to the (x+1) column pixel in width dimension)
yendp The y coordinate of the other vertex(corresponding to the (y+1) row pixel in height dimension)
zendp The z coordinate of the other vertex(corresponding to the (z+1) vertical pixel in image number dimension)

void mitkVolumeCropFilter::SetCropRegion int  xbeginp,
int  ybeginp,
int  zbeginp,
int  xlength,
int  ylength,
int  zlength
 

Set crop parameters using one vertex and the length from this vertex to the diagonal one . The vertex coordinate can be out of the definition area(0 ~ width-1,0 ~ height-1,0 ~ imagenember-1). And the length can be positive or negative.

Parameters:
xbeginp The x coordinate of one vertex(corresponding to the (x+1) column pixel in width dimension)
ybeginp The y coordinate of one vertex(corresponding to the (y+1) row pixel in height dimension)
zbeginp The z coordinate of one vertex(corresponding to the (z+1) vertical pixel in image number dimension)
xlength The distance from this vertex to the other in x axis(has xlength pixel units )
ylength The distance from this vertex to the other in y axis(has ylength pixel units )
zlength The distance from this vertex to the other in z axis(has zlength pixel units )


The documentation for this class was generated from the following file:
Generated on Tue Feb 25 15:07:11 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3