Hi
I currently made it over converting it to a vtkImagedata but it looks awful:
typedef itk::ImageToVTKImageFilter<TImage3D_US> TVTKConverter;
TVTKConverter::Pointer oC = TVTKConverter::New();
oC->SetInput(o3DImageStack.at(0).GetPointer());
oC->Update();
oImage->Initialize(oC->GetOutput(),1,o3DImageStack.size());
oImage->SetVolume(oC->GetOutput()->GetScalarPointer(), 0);
for(unsigned int i=1; i<o3DImageStack.size(); i++)
{
oC->SetInput(o3DImageStack.at(i).GetPointer());
oC->Update();
oImage->SetVolume(oC->GetOutput()->GetScalarPointer(), i);
}
Your solution over the timeslicedgeometry does not work (for me :)):
1) m_VectorOf3DImages[ 0 ]->GetGeometry -> there is no GetGeometry of an
itk::Image. Should I first convert it to a mitk::Image?
2) There is not mitk::Image::SetTimeSlicedGeometry method in mitk::Image, only
a getter which returns a constant. So how do I combine the timeslicedgeometry
with the mitk::Image (over SetGeometry?)
Best regards
Von: Hering, Jan [mailto:[email protected]]
Gesendet: Donnerstag, 12. April 2012 12:03
An: Lodron, Gerald; MITK ([email protected])
Betreff: AW: 4D image initialization form itk 3d image stack
Hi Lodron,
the method Image::InitializeByItk can't extend or change the dimensionality of
the image. So with the call
mitkImage->InitializeByItk( SomeITK-3D-Image, ...)
the mitkImage will have the same dimensionality ( i.e. 3 ) and also same
dimension sizes. The remaining parameters in the function definition can
change the corresponding dimension size but ONLY if the dimension is available
in the given input image.
Solution for your problem is to create an mitk::Image with 4 dimensions, and
also initialize it with a TimeSlicedGeometry:
Could look like:
mitk::Image::Pointer image4D = mitk::Image::New();
mitk::TimeSlicedGeometry::Pointer geom = mitk::TimeSlicedGeometry::New();
geom->InitializeEvenlyTimed( m_VectorOf3DImages[ 0 ]->GetGeometry(),
m_VectorOf3DImages.size() );
Regards,
Jan
Von: Lodron, Gerald
[mailto:[email protected]]<mailto:[mailto:[email protected]]>
Gesendet: Donnerstag, 12. April 2012 10:59
An: MITK
([email protected]<mailto:[email protected]>)
Betreff: [mitk-users] 4D image initialization form itk 3d image stack
Hi
I try to make a 4d mitk image form a stack of 3d itk images (gray), can anyone
tell me what i am making wrong:
Std::vector<itk::Image<unsigned short, 3>::Pointer> o3DImageStack;//my filled
itk image array
mitk::DataNode::Pointer oNode = mitk::DataNode::New();
mitk::Image::Pointer oImage = mitk::Image::New();
oImage->InitializeByItk(o3DImageStack.at(0).GetPointer(),1,o3DImageStack.size());
for(unsigned int i=0; i<o3DImageStack.size(); i++)
{
oImage->SetVolume(o3DImageStack.at(i)->GetBufferPointer(), i);
}
oNode->SetData(oImage);
oDS.Add(oNode);
In the mitk GUI the image has only 1 time step in timeslicedgeometry
Best regards
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users