Package org.itk.simple
Class ExtractImageFilter
java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.ExtractImageFilter
Decrease the image size by cropping the image to the selected region
bounds.
ExtractImageFilter changes the image boundary of an image by removing pixels outside the
target region. The region is specified as a Size and Index. The Size must be specified, while the Index defaults to zeros.
ExtractImageFilter can collapses dimensions so that the input image may have more
dimensions than the output image (i.e. 4-D input image to a 3-D output
image). To specify what dimensions to collapse, the Size must be specified. For any dimension dim where the Size[dim] == 0, that dimension is collapsed. The index to collapse on is
specified by Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want
to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D
(i.e. the 3rd "time" slice from 4D). The Size = [4,4,4,0] and Index = [0,0,0,2].
The number of dimension in Size and Index must at least dimension of the input image. The number of non-zero
dimensions in Size determines the output dimension.
Determining the direction of the collapsed output image from an larger
dimensional input space is an ill defined problem in general. It is
required that the application developer select the desired
transformation strategy for collapsing direction cosines. The strategy
defaults to the guess approach. Direction Collapsing Strategies: 1)
DirectionCollapseToUnknown(); This is the default in ITK and the
filter can not run when this is set. 1) DirectionCollapseToIdentity();
Output has identity direction no matter what 2)
DirectionCollapseToSubmatrix(); Output direction is the sub-matrix if
it is positive definite, else throw an exception.
This filter is implemented as a multithreaded filter. It provides a
DynamicThreadedGenerateData() method for its implementation.
See:
CropImageFilter
itk::simple::Extract for the procedural interface
itk::ExtractImageFilter for the Doxygen on the original ITK class.
C++ includes: sitkExtractImageFilter.h
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
-
Field Summary
Fields inherited from class org.itk.simple.ProcessObject
swigCMemOwn
-
Constructor Summary
ConstructorsModifierConstructorDescriptionitk::simple::ExtractImageFilter::ExtractImageFilter() Default Constructor that takes no arguments and initializes default parametersprotected
ExtractImageFilter
(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
virtual itk::simple::ExtractImageFilter::~ExtractImageFilter() DestructorImage itk::simple::ExtractImageFilter::Execute(Image &&image1) Execute the filter on the input imageprotected void
finalize()
protected static long
DirectionCollapseToStrategyType itk::simple::ExtractImageFilter::GetDirectionCollapseToStrategy() const Get the currently set strategy for collapsing directions of physical space.getIndex()
std::vector<int> itk::simple::ExtractImageFilter::GetIndex() const Get the starting index to extract.getName()
std::string itk::simple::ExtractImageFilter::GetName() const Name of this classgetSize()
std::vector<unsigned int> itk::simple::ExtractImageFilter::GetSize() const Get the size of the region to extract.void
setDirectionCollapseToStrategy
(ExtractImageFilter.DirectionCollapseToStrategyType DirectionCollapseToStrategy) Self& itk::simple::ExtractImageFilter::SetDirectionCollapseToStrategy(DirectionCollapseToStrategyType DirectionCollapseToStrategy) Set the strategy to be used to collapse physical space dimensions.void
setIndex
(VectorInt32 Index) Self& itk::simple::ExtractImageFilter::SetIndex(std::vector< int > Index) Set the starting index of the input image to extract.void
setSize
(VectorUInt32 Size) Self& itk::simple::ExtractImageFilter::SetSize(std::vector< unsigned int > Size) Set the size of the region to extract.protected static long
toString()
std::string itk::simple::ExtractImageFilter::ToString() const Print ourselves outMethods inherited from class org.itk.simple.ImageFilter
getCPtr, swigRelease
Methods inherited from class org.itk.simple.ProcessObject
abort, addCommand, debugOff, debugOn, getCPtr, getDebug, getGlobalDefaultCoordinateTolerance, getGlobalDefaultDebug, getGlobalDefaultDirectionTolerance, getGlobalDefaultNumberOfThreads, getGlobalDefaultThreader, getGlobalWarningDisplay, getNumberOfThreads, getNumberOfWorkUnits, getProgress, globalDefaultDebugOff, globalDefaultDebugOn, globalWarningDisplayOff, globalWarningDisplayOn, hasCommand, removeAllCommands, setDebug, setGlobalDefaultCoordinateTolerance, setGlobalDefaultDebug, setGlobalDefaultDirectionTolerance, setGlobalDefaultNumberOfThreads, setGlobalDefaultThreader, setGlobalWarningDisplay, setNumberOfThreads, setNumberOfWorkUnits, swigRelease
-
Constructor Details
-
ExtractImageFilter
protected ExtractImageFilter(long cPtr, boolean cMemoryOwn) -
ExtractImageFilter
public ExtractImageFilter()itk::simple::ExtractImageFilter::ExtractImageFilter() Default Constructor that takes no arguments and initializes default parameters
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classImageFilter
-
delete
public void delete()virtual itk::simple::ExtractImageFilter::~ExtractImageFilter() Destructor- Overrides:
delete
in classImageFilter
-
setSize
Self& itk::simple::ExtractImageFilter::SetSize(std::vector< unsigned int > Size) Set the size of the region to extract. The size of the region to extract should be specified. Dimensions which have a size of 0 are collapsed. The number of non-zero sized determines the output dimension. -
getSize
std::vector<unsigned int> itk::simple::ExtractImageFilter::GetSize() const Get the size of the region to extract. -
setIndex
Self& itk::simple::ExtractImageFilter::SetIndex(std::vector< int > Index) Set the starting index of the input image to extract. The index defaults to all zeros. -
getIndex
std::vector<int> itk::simple::ExtractImageFilter::GetIndex() const Get the starting index to extract. -
setDirectionCollapseToStrategy
public void setDirectionCollapseToStrategy(ExtractImageFilter.DirectionCollapseToStrategyType DirectionCollapseToStrategy) Self& itk::simple::ExtractImageFilter::SetDirectionCollapseToStrategy(DirectionCollapseToStrategyType DirectionCollapseToStrategy) Set the strategy to be used to collapse physical space dimensions. DIRECTIONCOLLAPSETOIDENTITY Set the strategy so that all collapsed images have an identity direction. Use this strategy when you know that retention of the physical space orientation of the collapsed image is not important. DIRECTIONCOLLAPSETOGUESS Set the strategy so that all collapsed images where output direction is the sub-matrix if it is positive definite, else return identity. This is backwards compatible with ITKv3, but is highly discouraged because the results are difficult to anticipate under differing data scenarios. DIRECTIONCOLLAPSETOSUBMATRIX Set the strategy so that all collapsed images where output direction is the sub-matrix if it is positive definite, else throw an exception. Use this strategy when it is known that properly identified physical space sub-volumes can be reliably extracted from a higher dimensional space. For example when the application programmer knows that a 4D image is 3D+time, and that the 3D sub-space is properly defined. -
getDirectionCollapseToStrategy
DirectionCollapseToStrategyType itk::simple::ExtractImageFilter::GetDirectionCollapseToStrategy() const Get the currently set strategy for collapsing directions of physical space. -
getName
std::string itk::simple::ExtractImageFilter::GetName() const Name of this class- Overrides:
getName
in classProcessObject
-
toString
std::string itk::simple::ExtractImageFilter::ToString() const Print ourselves out- Overrides:
toString
in classProcessObject
-
execute
Image itk::simple::ExtractImageFilter::Execute(Image &&image1) Execute the filter on the input image
-