25 for (i = 0; i < 4; ++i)
34 m_LargestPossibleRegion(other.m_LargestPossibleRegion),
35 m_RequestedRegion(other.m_RequestedRegion),
36 m_RequestedRegionInitialized(other.m_RequestedRegionInitialized),
37 m_BufferedRegion(other.m_BufferedRegion),
38 m_UseLargestPossibleRegion(other.m_UseLargestPossibleRegion)
47 Superclass::UpdateOutputInformation();
49 if (this->GetSource().IsNull())
53 m_UseLargestPossibleRegion =
true;
60 if (!m_RequestedRegionInitialized)
62 this->SetRequestedRegionToLargestPossibleRegion();
63 m_RequestedRegionInitialized =
true;
66 m_LastRequestedRegionWasOutsideOfTheBufferedRegion = 0;
71 if (GetUpdateMTime() < GetPipelineMTime() || GetDataReleased())
79 m_UseLargestPossibleRegion =
true;
80 if (GetGeometry() ==
nullptr)
83 const RegionType::IndexType &index = GetLargestPossibleRegion().GetIndex();
84 const RegionType::SizeType &size = GetLargestPossibleRegion().GetSize();
85 for (i = 0; i < RegionDimension; ++i)
87 m_RequestedRegion.SetIndex(i, index[i]);
88 m_RequestedRegion.SetSize(i, size[i]);
99 const IndexType &requestedRegionIndex = m_RequestedRegion.GetIndex();
101 const SizeType &requestedRegionSize = m_RequestedRegion.GetSize();
102 const SizeType &largestPossibleRegionSize = GetLargestPossibleRegion().GetSize();
106 c = requestedRegionIndex[4];
107 cEnd = c +
static_cast<long>(requestedRegionSize[4]);
108 if (requestedRegionSize[3] == largestPossibleRegionSize[3])
110 for (; c < cEnd; ++c)
111 if (IsChannelSet(c) ==
false)
118 t = requestedRegionIndex[3];
119 tEnd = t +
static_cast<long>(requestedRegionSize[3]);
120 if (requestedRegionSize[2] == largestPossibleRegionSize[2])
122 for (; c < cEnd; ++c)
123 for (; t < tEnd; ++t)
124 if (IsVolumeSet(t, c) ==
false)
131 s = requestedRegionIndex[2];
132 sEnd = s +
static_cast<long>(requestedRegionSize[2]);
133 for (; c < cEnd; ++c)
134 for (; t < tEnd; ++t)
135 for (; s < sEnd; ++s)
136 if (IsSliceSet(s, t, c) ==
false)
144 if (GetTimeGeometry() ==
nullptr)
152 const IndexType &requestedRegionIndex = m_RequestedRegion.GetIndex();
153 const IndexType &largestPossibleRegionIndex = GetLargestPossibleRegion().GetIndex();
155 const SizeType &requestedRegionSize = m_RequestedRegion.GetSize();
156 const SizeType &largestPossibleRegionSize = GetLargestPossibleRegion().GetSize();
158 for (i = 0; i < RegionDimension; ++i)
160 if ((requestedRegionIndex[i] < largestPossibleRegionIndex[i]) ||
161 ((requestedRegionIndex[i] + static_cast<long>(requestedRegionSize[i])) >
162 (largestPossibleRegionIndex[i] + static_cast<long>(largestPossibleRegionSize[i]))))
173 m_UseLargestPossibleRegion =
false;
180 m_RequestedRegionInitialized =
true;
185 itkExceptionMacro(<<
"mitk::SlicedData::SetRequestedRegion(DataObject*) cannot cast " <<
typeid(data).name()
193 m_UseLargestPossibleRegion =
false;
195 if (region !=
nullptr)
197 m_RequestedRegion = *region;
198 m_RequestedRegionInitialized =
true;
203 itkExceptionMacro(<<
"mitk::SlicedData::SetRequestedRegion(SlicedData::RegionType*) cannot cast "
204 <<
typeid(region).name()
212 if (region !=
nullptr)
214 m_LargestPossibleRegion = *region;
215 m_UseLargestPossibleRegion =
true;
220 itkExceptionMacro(<<
"mitk::SlicedData::SetLargestPossibleRegion(SlicedData::RegionType*) cannot cast "
221 <<
typeid(region).name()
230 Superclass::CopyInformation(data);
243 itkExceptionMacro(<<
"mitk::SlicedData::CopyInformation(const DataObject *data) cannot cast " <<
typeid(data).name()
260 if (GetTimeGeometry() ==
nullptr)
262 return dynamic_cast<SlicedGeometry3D *
>(GetTimeGeometry()->GetGeometryForTimeStep(t).GetPointer());
267 SetRequestedRegionToLargestPossibleRegion();
269 UpdateOutputInformation();
271 return GetSlicedGeometry(t);
276 if (aGeometry3D !=
nullptr)
280 if (slicedGeometry.IsNull())
283 if (geometry2d !=
nullptr && dynamic_cast<mitk::AbstractTransformGeometry *>(aGeometry3D) ==
nullptr)
285 if ((GetSlicedGeometry()->GetPlaneGeometry(0) == geometry2d) && (GetSlicedGeometry()->GetSlices() == 1))
288 slicedGeometry->InitializeEvenlySpaced(geometry2d, 1);
294 planeGeometry->InitializeStandardPlane(aGeometry3D);
295 slicedGeometry->InitializeEvenlySpaced(planeGeometry, (
unsigned int)(aGeometry3D->
GetExtent(2)));
298 assert(slicedGeometry.IsNotNull());
300 timeGeometry->Initialize(slicedGeometry, 1);
301 Superclass::SetTimeGeometry(timeGeometry);
305 if (GetGeometry() ==
nullptr)
307 Superclass::SetGeometry(
nullptr);
320 assert(timeGeometry !=
nullptr);
324 unsigned int steps = timeGeometry->CountTimeSteps();
326 for (
unsigned int timestep = 0; timestep < steps; ++timestep)
328 slicedGeometry = GetSlicedGeometry(timestep);
329 if (slicedGeometry !=
nullptr)
352 assert(timeGeometry !=
nullptr);
354 unsigned int steps = timeGeometry->CountTimeSteps();
356 for (
unsigned int timestep = 0; timestep < steps; ++timestep)
359 if (slicedGeometry !=
nullptr)
ScalarType GetExtent(unsigned int direction) const
Set the time bounds (in ms)
virtual void SetRequestedRegionToLargestPossibleRegion() override
virtual void SetGeometry(BaseGeometry *aGeometry3D) override
Set the BaseGeometry of the data, which will be referenced (not copied!). It has to be a sub-class of...
void SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing=false)
Set the spacing (m_Spacing).
Base of all data objects.
virtual const RegionType & GetRequestedRegion() const
virtual void SetRequestedRegion(const itk::DataObject *data) override
virtual void PrepareForNewData() override
virtual void InitializeEvenlySpaced(mitk::PlaneGeometry *geometry2D, unsigned int slices)
Completely initialize this instance as evenly-spaced with slices parallel to the provided PlaneGeomet...
itk::Size< RegionDimension > SizeType
void SetLargestPossibleRegion(SlicedData::RegionType *region)
Sets the largest possible region. The largest possible region is the entire region occupied by the da...
virtual void SetOrigin(const Point3D &origin) override
Convenience method for setting the origin of the SlicedGeometry3D instances of all time steps...
virtual bool GetEvenlySpaced() const
Set/Get whether the SlicedGeometry3D is evenly-spaced (m_EvenlySpaced)
Super class of data objects consisting of slices.
itk::ImageRegion< RegionDimension > RegionType
void SetOrigin(const Point3D &origin)
Set the origin, i.e. the upper-left corner of the plane.
virtual mitk::PlaneGeometry * GetPlaneGeometry(int s) const
Returns the PlaneGeometry of the slice (s).
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override
RegionType m_LargestPossibleRegion
const RegionType & GetLargestPossibleRegion() const
virtual unsigned int GetSlices() const
Get the number of slices.
Describes the geometry of a data object consisting of slices.
const SlicedGeometry3D * GetUpdatedSlicedGeometry(unsigned int t=0)
Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it)...
SlicedGeometry3D * GetSlicedGeometry(unsigned int t=0) const
Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it)...
Describes a two-dimensional, rectangular plane.
virtual void UpdateOutputInformation() override
virtual void SetSpacing(const ScalarType aSpacing[])
Convenience method for setting the spacing of the SlicedGeometry3D instances of all time steps...
void Update()
Updates the geometry.
virtual bool VerifyRequestedRegion() override
Verify that the RequestedRegion is within the LargestPossibleRegion.
BaseGeometry Describes the geometry of a data object.
virtual void CopyInformation(const itk::DataObject *data) override