19 #include <itkObjectFactoryBase.h>
33 m_SourceOutputIndexDuplicate(other.m_SourceOutputIndexDuplicate),
34 m_Initialized(other.m_Initialized)
36 m_TimeGeometry =
dynamic_cast<TimeGeometry *
>(other.m_TimeGeometry->Clone().GetPointer());
37 m_PropertyList = other.m_PropertyList->Clone();
48 baseGeo->Initialize();
55 timeGeometry->Initialize();
56 timeGeometry->Expand(timeSteps);
59 timeGeometry->SetTimeStepGeometry(baseGeo.GetPointer(), step);
65 if (this->GetSource())
67 this->GetSource()->UpdateOutputInformation();
69 if (m_TimeGeometry.IsNotNull())
71 m_TimeGeometry->UpdateBoundingBox();
77 SetRequestedRegionToLargestPossibleRegion();
79 UpdateOutputInformation();
81 return GetTimeGeometry();
86 if (m_TimeGeometry.IsNotNull())
88 m_TimeGeometry->Expand(timeSteps);
92 this->InitializeTimeGeometry(timeSteps);
98 SetRequestedRegionToLargestPossibleRegion();
100 UpdateOutputInformation();
102 return GetGeometry(t);
108 if (geometry !=
nullptr)
110 timeGeometry->Initialize(geometry, 1);
112 SetTimeGeometry(timeGeometry);
118 m_TimeGeometry = geometry;
124 SetGeometry(static_cast<mitk::BaseGeometry *>(aGeometry3D->
Clone().GetPointer()));
130 SetTimeGeometry(clonedGeometry.GetPointer());
137 m_TimeGeometry->SetTimeStepGeometry(static_cast<mitk::BaseGeometry *>(aGeometry3D->
Clone().GetPointer()), time);
143 return IsInitialized() ==
false;
148 if (IsInitialized() ==
false)
151 if (timeGeometry ==
nullptr)
153 unsigned int timeSteps = timeGeometry->CountTimeSteps();
154 for (
unsigned int t = 0; t < timeSteps; ++t)
156 if (IsEmptyTimeStep(t) ==
false)
169 return m_PropertyList;
174 return m_PropertyList->GetProperty(propertyKey);
179 m_PropertyList->SetProperty(propertyKey, propertyValue);
184 m_PropertyList = pList;
191 assert(timeGeom !=
nullptr);
194 for (
TimeStepType timestep = 0; timestep < steps; ++timestep)
196 auto geometry = GetGeometry(timestep);
197 if (geometry !=
nullptr)
199 geometry->SetOrigin(origin);
206 unsigned long time = Superclass::GetMTime();
207 if (m_TimeGeometry.IsNotNull())
209 if ((time < m_TimeGeometry->GetMTime()))
212 return Superclass::GetMTime();
220 itkExceptionMacro(<<
"Graft not implemented for mitk::BaseData subclass " << this->GetNameOfClass())
225 const Self *bd =
dynamic_cast<const Self *
>(data);
238 itkExceptionMacro(<<
"mitk::BaseData::CopyInformation() cannot cast " <<
typeid(data).name() <<
" to "
239 <<
typeid(
Self *).name());
245 return m_Initialized;
251 this->InitializeEmpty();
259 m_Initialized =
false;
271 os << indent <<
" TimeGeometry: ";
272 if (GetTimeGeometry() ==
nullptr)
273 os <<
"NULL" << std::endl;
275 GetTimeGeometry()->Print(os, indent);
278 if (propertyList.IsNotNull() && !propertyList->IsEmpty())
281 os <<
"Properties of BaseData:" << std::endl;
284 for (PropertyList::PropertyMap::const_iterator iter = map->begin(); iter != map->end(); ++iter)
286 os <<
" " << (*iter).first <<
" " << (*iter).second->GetValueAsString() << std::endl;
virtual void SetOrigin(const Point3D &origin)
Convenience method for setting the origin of the BaseGeometry instances of all time steps...
virtual void ClearData()
reset to non-initialized state, release memory
virtual void SetClonedTimeGeometry(const TimeGeometry *geometry)
Set a clone of the provided TimeGeometry as TimeGeometry of the data.
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override
Base of all data objects.
Base class of all Operation-classes.
virtual void SetGeometry(BaseGeometry *aGeometry3D)
Set the BaseGeometry of the data, which will be referenced (not copied!). Assumes the data object has...
virtual void SetTimeGeometry(TimeGeometry *geometry)
Set the TimeGeometry of the data, which will be referenced (not copied!).
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
const mitk::TimeGeometry * GetTimeGeometry() const
Return the TimeGeometry of the data as const pointer.
Key-value list holding instances of BaseProperty.
virtual bool IsEmptyTimeStep(unsigned int t) const
Check whether object contains data (at a specified time), e.g., a set of points may be empty...
void SetPropertyList(PropertyList *propertyList)
Set the data's property list.
abstract class, that can be used by Undo to undo an operation.
void ExecuteOperation(Operation *operation) override
overwrite if the Data can be called by an Interactor (StateMachine).
void SetProperty(const char *propertyKey, BaseProperty *property)
virtual void Graft(const DataObject *) override
Abstract base class for properties.
std::map< std::string, BaseProperty::Pointer > PropertyMap
mitk::PropertyList::Pointer GetPropertyList() const
Get the data's property list.
itk::SmartPointer< mitk::BaseDataSource > GetSource() const
Get the process object that generated this data object.
std::vcl_size_t TimeStepType
virtual unsigned long GetMTime() const override
Get the modified time of the last change of the contents this data object or its geometry.
void UpdateOutputInformation() override
Update the information for this BaseData (the geometry in particular) so that it can be used as an ou...
const mitk::BaseGeometry * GetUpdatedGeometry(int t=0)
Return the BaseGeometry of the data at time t.
virtual void Clear()
Calls ClearData() and InitializeEmpty();.
const mitk::TimeGeometry * GetUpdatedTimeGeometry()
Return the TimeGeometry of the data.
virtual bool IsEmpty() const
Check whether object contains data (at least at one point in time), e.g., a set of points may be empt...
virtual bool IsInitialized() const
Check whether the data has been initialized, i.e., at least the Geometry and other header data has be...
virtual void SetClonedGeometry(const BaseGeometry *aGeometry3D)
Set a clone of the provided TimeGeometry as TimeGeometry of the data. Assumes the data object has onl...
mitk::BaseProperty::Pointer GetProperty(const char *propertyKey) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList, and set it to this, respectively;.
virtual void Expand(unsigned int timeSteps)
Expands the TimeGeometry to a number of TimeSteps.
virtual void InitializeTimeGeometry(unsigned int timeSteps=1)
Initialize the TimeGeometry for a number of time steps. The TimeGeometry is initialized empty and eve...
BaseGeometry Describes the geometry of a data object.
void CopyInformation(const itk::DataObject *data) override
Copy information from the specified data set.