<HTML><HEAD>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 10.00.9200.16736"></HEAD>
<BODY style="FONT: 10pt Segoe UI; MARGIN: 4px 4px 1px">
<DIV>Hi Susi,</DIV>
<DIV> </DIV>
<DIV>if I remember right, this is only an vtkImageActor isse, as the metaImageReader handles the ZDim value in the mhd/mha headers correctly.</DIV>
<DIV> </DIV>
<DIV>Try using <SPAN class=comment-copy>vtkImageSliceMapper instead of vtkImageActor ( <A href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageSliceMapper">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageSliceMapper</A> )</SPAN></DIV>
<DIV><SPAN class=comment-copy></SPAN> </DIV>
<DIV><SPAN class=comment-copy>Best regards</SPAN></DIV>
<DIV><SPAN class=comment-copy>Adrian</SPAN></DIV>
<DIV><SPAN style="WORD-WRAP: normal; FONT-SIZE: 10pt; FONT-WEIGHT: normal">
<DIV><BR></DIV>
<DIV>--<BR>Adrian Gabriel</DIV>
<DIV>Software Developer<BR>4plus GmbH<BR>Am Weichselgarten 36<BR>D-91058 Erlangen</DIV>
<DIV> </DIV>
<DIV>Tel.: +49-(0)9131-812928-919</DIV>
<DIV>E-Mail: <A href="mailto:adrian.gabriel@4plus.de">adrian.gabriel@4plus.de</A></DIV>
<DIV>Web: <A href="http://www.4plus.de/">http://www.4plus.de</A> </DIV></SPAN><BR><BR>>>> "Susanne Schmalkalt" <Susanne.Schmalkalt@gmx.de> 21.11.2013 14:34 >>><BR></DIV>
<DIV style="FONT-SIZE: 12px; FONT-FAMILY: Verdana">
<DIV>Hallo,</DIV>
<DIV> </DIV>
<DIV>I'm trying to read a 3d binary image (.mhd or .mha) via vtkMetaImageReader. But the output is only 2d. How can I tell the fileReader that my image has 3 dimensions?</DIV>
<DIV> </DIV>
<DIV>That's my code:</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> vtkSmartPointer<vtkMetaImageReader> fileReader=<BR> vtkSmartPointer<vtkMetaImageReader>::New();</DIV>
<DIV>
<DIV> fileReader->SetFileName(filename); </DIV>
<DIV> fileReader->Update();</DIV>
<DIV> // Visualize<BR> vtkSmartPointer<vtkImageActor> actor =<BR> vtkSmartPointer<vtkImageActor>::New();<BR> actor->GetMapper()->SetInputConnection(fileReader->GetOutputPort());<BR> <BR> vtkSmartPointer<vtkRenderer> renderer =<BR> vtkSmartPointer<vtkRenderer>::New();<BR> renderer->AddActor(actor);<BR> renderer->ResetCamera();<BR> <BR> vtkSmartPointer<vtkRenderWindow> renderWindow =<BR> vtkSmartPointer<vtkRenderWindow>::New();<BR> renderWindow->AddRenderer(renderer);<BR> <BR> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =<BR> vtkSmartPointer<vtkRenderWindowInteractor>::New();<BR> vtkSmartPointer<vtkInteractorStyleImage> style =<BR> vtkSmartPointer<vtkInteractorStyleImage>::New();<BR> <BR> renderWindowInteractor->SetInteractorStyle(style);<BR> <BR> renderWindowInteractor->SetRenderWindow(renderWindow);<BR> renderWindowInteractor->Initialize();<BR> <BR> renderWindowInteractor->Start();</DIV>
<DIV> </DIV>
<DIV>Thanks!</DIV>
<DIV>Susi</DIV></DIV></DIV><BR>
<font face="Times New Roman">4 Plus Gesellschaft für Software- und
Hardwareentwicklung mbH; </font><br><font face="Times New Roman">Geschäftsführer:
Hans Janschitz, Karl Kapp, Tibor Takàcs; </font><br><font face="Times New Roman">Sitz
der Gesellschaft: Erlangen </font><br><font face="Times New Roman">Registergericht:
Fürth, Nr. B7288</font>
</BODY></HTML>