[vtkusers] SetDataSpacing does not work

samo sandra.moritz at gmx.de
Fri Oct 6 10:41:02 EDT 2006



Well, I tried now vtkImageChangeInformation, and the
m_MetaVolumeReader->GetOutput()->SetSpacing........

but both did not work. 

I try to change the spacing as the picture on the screen is too small and I
thought, the easieast way might just be to change the data spacing. But
maybe I should try to transform the volume. I have no idea, as I am totally
new to vtk and do not know what possibilities I have.

Thank you very much for any further help.





John Biddiscombe wrote:
> 
> But you should really use vtkImageChangeInformartion to preserve the 
> change after filter updates.
> 
> JB
> 
>> samo wrote:
>>>
>>> Hello there
>>>
>>> I try to manipulate the data spacing from the data I get with
>>> vtkMetaImageReader. The problem is, that after a pipeline update, the
>>> spacing is set back to its original values. I don't understand why this
>>> happens. Why is vtk just ignoring the SetDataSpacing?
>>>
>>> This is my code:
>>>
>>> vtkMetaImageReader *in_Reader = vtkMetaImageReader::New();
>>> in_Reader->SetFileName( "MyFile.mhd" );   
>>> in_Reader->Update();
>>> in_Reader->SetDataSpacing(1.0,1.0,5.0);  //at this point, the spacing is
>>> correct
>>
>>
>> Try changing that to:
>>
>> in_Reader->GetOutput()->SetSpacing(1.,1.,5.);
>>
>> HTH
>> Mathieu
>> Ps: why would you want to change the spacing when it is read from a 
>> file with a header ?
>> _______________________________________________
>> This is the private VTK discussion list. Please keep messages 
>> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 
> -- 
> John Biddiscombe,                            email:biddisco @ cscs.ch
> http://www.cscs.ch/about/BJohn.php
> CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
> Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 

-- 
View this message in context: http://www.nabble.com/SetDataSpacing-does-not-work-tf2393944.html#a6680670
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list