#include <mitkVolumeCropFilter.h>
Inherits mitkVolumeToVolumeFilter.
Inheritance diagram for mitkVolumeCropFilter:
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) |
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... }
mitkResizeFilter *filter = new mitkResizeFilter; filter->SetInput(InVolume); filter->SetCropRegion(xbeginp,ybeginp,zbeginp,xlength,ylength,zlength); if (filter->Run()) { mitkVolume * outVolume = filter->GetOutput(); Using outVolume... }
|
Print the necessary information about this object for the debugging purpose.
Reimplemented from mitkVolumeToVolumeFilter. |
|
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).
|
|
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.
|