[vtkusers] SetDataSpacing does not work

John Biddiscombe biddisco at cscs.ch
Fri Oct 6 10:15:52 EDT 2006


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





More information about the vtkusers mailing list