Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F223
copyinfo.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
schwarzt
Jun 3 2009, 5:05 PM
2009-06-03 17:05:35 (UTC+2)
Size
3 KB
Referenced Files
None
Subscribers
None
copyinfo.patch
View Options
Index: Core/Code/DataManagement/mitkBaseData.cpp
===================================================================
--- Core/Code/DataManagement/mitkBaseData.cpp (revision 17557)
+++ Core/Code/DataManagement/mitkBaseData.cpp (working copy)
@@ -304,6 +304,24 @@
return time;
}
+void mitk::BaseData::CopyInformation( const itk::DataObject* data )
+{
+ const Self* bd = dynamic_cast<const Self*>(data);
+ if (bd != NULL)
+ {
+ m_TimeSlicedGeometry = dynamic_cast<TimeSlicedGeometry*>(bd->GetTimeSlicedGeometry()->Clone().GetPointer());
+ m_PropertyList = bd->GetPropertyList()->Clone();
+ }
+ else
+ {
+ // pointer could not be cast back down
+ itkExceptionMacro(<< "mitk::BaseData::CopyInformation() cannot cast "
+ << typeid(data).name() << " to "
+ << typeid(Self*).name() );
+ }
+
+}
+
bool mitk::BaseData::IsInitialized() const
{
return m_Initialized;
Index: Core/Code/DataManagement/mitkBaseData.h
===================================================================
--- Core/Code/DataManagement/mitkBaseData.h (revision 17557)
+++ Core/Code/DataManagement/mitkBaseData.h (working copy)
@@ -178,11 +178,11 @@
//## BaseProcess will copy meta-data from the first input to all of its
//## outputs. See ProcessObject::GenerateOutputInformation(). Each
//## subclass of DataObject is responsible for being able to copy
- //## whatever meta-data it needs from from another DataObject.
- //## The default implementation of this method is empty. If a subclass
- //## overrides this method, it should always call its superclass'
- //## version.
- void CopyInformation(const itk::DataObject*) {};
+ //## whatever meta-data it needs from another DataObject.
+ //## The default implementation of this method copies the time sliced geometry
+ //## and the property list of an object. If a subclass overrides this
+ //## method, it should always call its superclass' version.
+ void CopyInformation(const itk::DataObject* data);
//##Documentation
//## @brief Check whether the data has been initialized, i.e.,
Index: Core/Code/DataManagement/mitkSlicedData.cpp
===================================================================
--- Core/Code/DataManagement/mitkSlicedData.cpp (revision 17557)
+++ Core/Code/DataManagement/mitkSlicedData.cpp (working copy)
@@ -208,7 +208,6 @@
if (slicedData)
{
m_LargestPossibleRegion = slicedData->GetLargestPossibleRegion();
- SetGeometry(dynamic_cast<Geometry3D*>(GetTimeSlicedGeometry()->Clone().GetPointer()));//new SlicedGeometry3D(*slicedData->GetGeometry().GetPointer());
}
else
{
Index: Core/Testing/CMakeLists.txt
===================================================================
--- Core/Testing/CMakeLists.txt (revision 17557)
+++ Core/Testing/CMakeLists.txt (working copy)
@@ -19,6 +19,7 @@
mitkImageDataItemTest.cpp
#mitkImageMapper2DTest.cpp
mitkImageTest.cpp
+ mitkBaseDataTest.cpp
#mitkImageToItkTest.cpp
mitkInteractorTest.cpp
mitkITKThreadingTest.cpp
Index: Modules/MitkExt/DataManagement/mitkUnstructuredGrid.cpp
===================================================================
--- Modules/MitkExt/DataManagement/mitkUnstructuredGrid.cpp (revision 17557)
+++ Modules/MitkExt/DataManagement/mitkUnstructuredGrid.cpp (working copy)
@@ -212,8 +212,10 @@
}
}
-void mitk::UnstructuredGrid::CopyInformation( const itk::DataObject * )
-{}
+void mitk::UnstructuredGrid::CopyInformation( const itk::DataObject * data )
+{
+ Superclass::CopyInformation(data);
+}
void mitk::UnstructuredGrid::Update()
{
File Metadata
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
214
Default Alt Text
copyinfo.patch (3 KB)
Attached To
Mode
T2111: CopyInformation of mitk::BaseData missing
Attached
Detach File
Event Timeline
•
schwarzt
added a comment.
Jun 3 2009, 5:05 PM
2009-06-03 17:05:35 (UTC+2)
Comment Actions
Fix for the problem
Log In to Comment