Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F584
mitkImageDataItem.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
schwarzt
Sep 9 2010, 2:33 PM
2010-09-09 14:33:40 (UTC+2)
Size
2 KB
Referenced Files
None
Subscribers
None
mitkImageDataItem.patch
View Options
Index: DataManagement/mitkImageDataItem.cpp
===================================================================
--- DataManagement/mitkImageDataItem.cpp (revision 25597)
+++ DataManagement/mitkImageDataItem.cpp (working copy)
@@ -130,9 +130,7 @@
{
inData->SetDimensions( m_PicDescriptor->n[0], m_PicDescriptor->n[1], m_PicDescriptor->n[2] );
size = m_PicDescriptor->n[0] * m_PicDescriptor->n[1] * m_PicDescriptor->n[2];
- // Test
- //inData->SetOrigin( (float) m_PicDescriptor->n[0] / 2.0f, (float) m_PicDescriptor->n[1] / 2.0f, (float) m_PicDescriptor->n[2] / 2.0f );
- inData->SetOrigin( 0, 0, 0 );
+ inData->SetOrigin( (float) m_PicDescriptor->n[0] / 2.0f, (float) m_PicDescriptor->n[1] / 2.0f, (float) m_PicDescriptor->n[2] / 2.0f );
}
else
{
Index: Testing/mitkImageTest.cpp
===================================================================
--- Testing/mitkImageTest.cpp (revision 25597)
+++ Testing/mitkImageTest.cpp (working copy)
@@ -408,6 +408,19 @@
origin2 = mitkByVtkImage->GetTimeSlicedGeometry()->GetOrigin();
MITK_TEST_CONDITION_REQUIRED(mitk::Equal(origin2,vtkoriginAsMitkPoint), "");
+ // Testing GetVtkImageData
+ MITK_TEST_OUTPUT(<< " Testing GetVtkImageData(0,0)");
+ vtkImageData* vtkimage2 = mitkByVtkImage->GetVtkImageData(0,0);
+ MITK_TEST_CONDITION_REQUIRED(vtkimage2==vtkimage, "");
+
+ MITK_TEST_OUTPUT(<< " Testing spacing of vtk image output");
+ double* vtkspacing2 = vtkimage2->GetSpacing();
+ MITK_TEST_CONDITION_REQUIRED( (vtkspacing2[0] == vtkspacing[0]) && (vtkspacing2[1] == vtkspacing[1]) && (vtkspacing2[2] == vtkspacing[2]), "");
+
+ MITK_TEST_OUTPUT(<< " Testing origin of vtk image output");
+ double* vtkorigin2 = vtkimage2->GetOrigin();
+ MITK_TEST_CONDITION_REQUIRED((vtkorigin2[0] == vtkorigin[0]) && (vtkorigin2[1] == vtkorigin[1]) && (vtkorigin2[2] == vtkorigin[2]), "");
+
// TODO test the following initializers on channel-incorporation
// void mitk::Image::Initialize(const mitk::PixelType& type, unsigned int dimension, unsigned int *dimensions, unsigned int channels)
// void mitk::Image::Initialize(const mitk::PixelType& type, int sDim, const mitk::Geometry2D& geometry2d, bool flipped, unsigned int channels, int tDim )
File Metadata
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
560
Default Alt Text
mitkImageDataItem.patch (2 KB)
Attached To
Mode
T5050: Bug in mitk::Image::GetVtkImageData(), Origin is wrong
Attached
Detach File
Event Timeline
•
schwarzt
added a comment.
Sep 9 2010, 2:33 PM
2010-09-09 14:33:40 (UTC+2)
Comment Actions
Patch
Log In to Comment