32 this->ProcessObject::SetNthInput(1, const_cast<mitk::BoundingObject *>(boundingObject));
37 : m_BoundingObject(nullptr),
40 m_AutoOutsideValue(false),
41 m_UseInsideValue(false),
42 m_OutsidePixelCount(0),
43 m_InsidePixelCount(0),
44 m_UseWholeInputRegion(false)
46 this->SetNumberOfIndexedInputs(2);
47 this->SetNumberOfRequiredInputs(2);
78 mitkThrow() <<
"Input is not a mitk::Image";
80 itkDebugMacro(<<
"GenerateOutputInformation()");
81 unsigned int dimension = input->GetDimension();
85 mitkThrow() <<
"ImageCropper cannot handle 1D or 2D Objects.";
111 index[0] = (mitk::SlicedData::IndexType::IndexValueType)(std::ceil(min[0]));
112 index[1] = (mitk::SlicedData::IndexType::IndexValueType)(std::ceil(min[1]));
113 index[2] = (mitk::SlicedData::IndexType::IndexValueType)(std::ceil(min[2]));
117 size[0] = (mitk::SlicedData::SizeType::SizeValueType)(std::ceil(max[0]) - index[0]);
118 size[1] = (mitk::SlicedData::SizeType::SizeValueType)(std::ceil(max[1]) - index[1]);
119 size[2] = (mitk::SlicedData::SizeType::SizeValueType)(std::ceil(max[2]) - index[2]);
131 boRegion.SetSize(size);
133 mitkThrow() <<
"No overlap of the image and the cropping object.";
143 auto dimensions =
new unsigned int[dimension];
146 memcpy(dimensions + 3, input->GetDimensions() + 3, (dimension - 3) *
sizeof(
unsigned int));
156 indexToWorldTransform->SetParameters(input->GetSlicedGeometry()->GetIndexToWorldTransform()->GetParameters());
203 int tstart = outputRegion.GetIndex(3);
204 int tmax = tstart + outputRegion.GetSize(3);
207 for (t = tstart; t < tmax; ++t)
mitk::BoundingObject::Pointer m_BoundingObject
itk::SmartPointer< Self > Pointer
void SetBoundingObject(const mitk::BoundingObject *boundingObject)
void SetIndexToWorldTransform(mitk::AffineTransform3D *transform)
virtual void GenerateData() override
A version of GenerateData() specific for image processing filters.
DataCollection - Class to facilitate loading/accessing structured data.
virtual const PixelType GetOutputPixelType()
friend void CutImage(itk::Image< TPixel, VImageDimension > *itkImage, mitk::BoundingObjectCutter *cutter, int boTimeStep)
itk::Size< RegionDimension > SizeType
virtual void GenerateOutputInformation() override
const mitk::BoundingObject * GetBoundingObject() const
virtual void GenerateInputRequestedRegion() override
itk::TimeStamp m_TimeOfHeaderInitialization
superclass of all bounding objects (cylinder, cuboid,...)
virtual void ComputeData(mitk::Image *input3D, int boTimeStep)
#define AccessFixedDimensionByItk_2(mitkImage, itkImageTypeFunction, dimension, arg1, arg2)
itk::ImageRegion< RegionDimension > RegionType
virtual TimeStepType TimePointToTimeStep(TimePointType timePoint) const =0
Converts a time point to the corresponding time step.
void SetOrigin(const Point3D &origin)
Set the origin, i.e. the upper-left corner of the plane.
Image class for storing images.
virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const =0
Converts a time step to a time point.
void vtk2itk(const Tin &in, Tout &out)
mitk::ScalarType TimePointType
mitk::SlicedData::RegionType m_InputRequestedRegion
mitk::ImageTimeSelector::Pointer m_InputTimeSelector
const mitk::PixelType GetPixelType(int n=0) const
Returns the PixelType of channel n.
mitk::BoundingBox::Pointer CalculateBoundingBoxRelativeToTransform(const mitk::AffineTransform3D *transform) const
Calculates a bounding-box around the geometry relative to a coordinate system defined by a transform...
Describes the geometry of a data object consisting of slices.
void GenerateTimeInInputRegion(const mitk::TimeGeometry *outputTimeGeometry, const TOutputRegion &outputRegion, const mitk::TimeGeometry *inputTimeGeometry, TInputRegion &inputRegion)
void itk2vtk(const Tin &in, Tout &out)
InputImageType * GetInput(void)
void IndexToWorld(const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const
Convert (continuous or discrete) index coordinates of a vector vec_units to world coordinates (in mm)...
vcl_size_t GetNumberOfComponents() const
Get the number of components of which each element consists.
virtual bool IsInitialized() const
Check whether the data has been initialized, i.e., at least the Geometry and other header data has be...
bool m_UseWholeInputRegion
OutputType * GetOutput()
Get the output data of this image source object.
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector
itk::ImageRegion< 5 > RegionType
virtual ~BoundingObjectCutter()
BaseGeometry Describes the geometry of a data object.
Class for defining the data type of pixels.
mitk::AffineTransform3D * GetIndexToWorldTransform()
Get the transformation used to convert from index to world coordinates.
#define AccessVectorFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, va_tuple)
Access a vector mitk-image with known dimension by a ITK vector image with one or more parameters...
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.