[Insight-users] Re: Additional question re modification of image structure parameters

Luis Ibanez luis.ibanez at kitware.com
Tue Oct 30 19:35:43 EDT 2007


Hi Frank,

Yes, this is normal.

You shouldn't attempt to change the internal elements of the pipeline.

The filters in the pipeline discard your manual changes, as soon as
the pipeline is executed.


What you may want to use is the ChangeInformationFilter.

with the methods

      filter->SetInput( fixedImageReader->GetOutput() );
      filter->ChangeOriginOn();
      filter->SetOutputOrigin( newOrigin );

      nextFilter->SetInput( filter->GetOutput();


You could also change the direction by using


      filter->ChangeDirectionOn();
      filter->SetOutputDirection( newDirection );


--

I'm surprised however that you need to change the origin manually...

It doesn't sound right...


If your scanner is providing the correct information,
then you shouldn't need to change anything...


Maybe I'm missing some more background on why you are change it.


    Regards,


       Luis


---------------------
Frank Ezekiel wrote:
> Luis:
> 
>         As part of preparation for loading the DCM and offset data from 
> our spectroscopy to use your alignment code, I need to modify DCM and 
> offset data on an already loaded image structure.
> 
>         fixedImageReader->GetImageIO()->SetOrigin(0,NewOrigin[0]);
>         fixedImageReader->GetImageIO()->SetOrigin(1,NewOrigin[1]);
>         fixedImageReader->GetImageIO()->SetOrigin(2,NewOrigin[2]);
> 
>         it appears to correctly modify the internal record.     But when 
> an image is written with the changed dimension information, it is 
> written as if there was no change.
> 
> Am I missing another trick here?
> 
> Thanks,
> 
> Frank


More information about the Insight-users mailing list