[Insight-developers] backward compatibility issue with new streaming support
M.Staring at lumc.nl
M.Staring at lumc.nl
Fri Dec 11 10:41:23 EST 2009
Hi Brad,
We upgraded from ITK 3.10 to the latest release 3.16.
With MetaImageIO we got an IORegion of size zero.
We just tested TiffImageIO, and that did not give a zero-sized region,
but it unfortunately did return a different image than we put into it.
Do you want us to test other IO's?
If we add the lines
itk::ImageIORegion ioRequestedRegion(nrOfDimensions);
itk::ImageIORegion actualIORegion =
m_itkImageIO->GenerateStreamableReadRegionFromRequestedRegion(ioRequeste
dRegion);
m_itkImageIO->SetIORegion(actualIORegion);
to our code, it seems to work again. Does that give you any ideas of
what's wrong?
Marius
> -----Original Message-----
> From: Bradley Lowekamp [mailto:blowekamp at mail.nih.gov]
> Sent: vrijdag 11 december 2009 16:19
> To: Staring, M. (LKEB)
> Cc: insight-developers at itk.org
> Subject: Re: [Insight-developers] backward compatibility
> issue with new streaming support
>
> What version were you upgrading from and to?
>
> Is it all readers that broke for you or just MetaImageIO?
>
> I am sorry that these changes broke your code, I tried very
> hard to ensure that the interface was backwards compatible.
>
> Brad
>
> On Dec 11, 2009, at 10:00 AM, M.Staring at lumc.nl wrote:
>
> > Dear developers,
> >
> > In our institute (LKEB) we sometimes use the ITK image IO classes
> > without using the itk::ImageFileReader. (This way we can
> e.g. directly
> > read in the data buffer into our own image type: lkebImage.)
> >
> > We recently updated the underlying ITK to a more recent version, and
> > found out that it did not work anymore. The reason it does
> not work are
> > the changes that were made to support streaming. A new
> member m_IORegion
> > was added to the class ImageIOBase; it's constructor
> initializes that
> > member to a 2D region of size [0 0]. The framework now
> expects that this
> > m_IORegion is set externally, which in the ITK is done in the
> > ImageFileReader (line 389 of the txx). However, we do not use the
> > ImageFileReader and therefore our code breaks.
> >
> > To fix this issue I would expect that the m_IORegion is by
> default set
> > to the largest possible region (or the requested region)
> and not to size
> > 0. I'm not sure if it is the best place to fix this, but
> this could be
> > fixed by adapting the Read() or
> ReadImageInformation()-functions of all
> > ImageIO's that support streaming. For example
> MetaImageIO::Read() could
> > check if m_IORegion was manually set, and if not set it to
> the requested
> > region. Something like:
> >
> > if ( !m_IORegionManuallySet ) // or: if (
> m_IORegion.GetSize() == 0 )
> > {
> > m_IORegion = m_RequestedRegion; // or: m_IORegion =
> > m_LargestPossibleRegion;
> > }
> >
> > and then proceed ...
> >
> > What do you think ?
> >
> > Regards,
> >
> > Marius
> >
> >
> > Marius Staring, PhD
> > Division of Image Processing (LKEB)
> > Department of Radiology
> > Leiden University Medical Center
> > PO Box 9600, 2300 RC Leiden, The Netherlands
> > phone: +31 (0)71 526 1106, fax: +31 (0)71 526 6801
> > m.staring at lumc.nl
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://kitware.com/products/protraining.html
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-developers
>
>
More information about the Insight-developers
mailing list