[Insight-developers] MetaImage Test failing on Mac
Stephen Aylward
stephen.aylward at kitware.com
Mon Jul 6 11:56:40 EDT 2009
I'd rather see it fixed in metaIO - going outside of metaIO to call a
function just to avoid a bug in metaIO seems like a bad idea :)
Seems like backward compatibility can be preserved. Add an arg to
ElementByteOrderFix that is the buffer size, but have it default to 0 which
implies use the full buffer (I know, I hate such hidden "features" but I'd
rather preserve backward compatibility and metaIO performs such badness
elsewhere so it is almost a design pattern :) ).
Thanks for catching this!!!
Stephen
On Mon, Jul 6, 2009 at 11:50 AM, Bradley Lowekamp <blowekamp at mail.nih.gov>wrote:
> Hello,
> I remember this test now, it did not work right when I first encountered
> it.
>
> 1) The itkMetaImageStreamingWriterIOTest2:
>
> # This test is failing to produce correct output
> ADD_TEST(itkMetaImageStreamingWriterIOTest2 ${IO_TESTS}
> # --compare ${ITK_DATA_ROOT}/Input/mri3D.mhd
> # ${ITK_TEST_OUTPUT_DIR}/mri3DWriteStreamed.mha
> itkMetaImageStreamingWriterIOTest
> ${ITK_DATA_ROOT}/Input/mri3D.mhd
> ${ITK_TEST_OUTPUT_DIR}/mri3DWriteStreamed.mha)
>
> The input mha file references a dcm file. And meta IO does not support
> streaming from that format well. Before I made any changes to the streaming
> IO, this test was passing, but not producing the correct output file on all
> systems.
>
> 2) The cause of the segfault is that MetaImage::ElementByteOrderSwap
> assumes the size of the buffer is the size of the image, but in the case of
> streaming this is not true. This problem could have been encountered before
> I made the recent changes to ImageFileReader. I see two possible solutions,
> A) add a MetaImage function to take the buffer size as a parameter, or B)
> have itkMetaImageIO not call MetaImage::ElementByteOrderFix, but instead
> call an itk::ByteSwapper. I think option B would be easiest.
>
> Brad
>
>
>
> On Jul 6, 2009, at 9:02 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote:
>
> I am pretty sure that this is my fault. I am going to look into it this
> morning.
> Brad
>
> On Jul 6, 2009, at 8:22 AM, Luis Ibanez wrote:
>
> Brad, Julien,
>
> The following test
>
> itkMetaImageStreamingWriterIOTest2<http://www.cdash.org/CDash/testSummary.php?project=2&name=itkMetaImageStreamingWriterIOTest2&date=2009-07-06>
>
> is failing (seg.faulting) on Macs.
>
> For example:
> http://www.cdash.org/CDash/testDetails.php?test=26512580&build=371914
>
>
> May this be related to the recent changes to the
> IO classes ?
>
> or to the recent changes to the MetaImage library ?
>
>
> Thanks for any hints,
>
>
> Luis
>
>
>
> ========================================================
> Bradley Lowekamp
> Lockheed Martin Contractor for
> Office of High Performance Computing and Communications
> National Library of Medicine
> blowekamp at mail.nih.gov
>
>
> <ATT00001.txt>
>
>
> ========================================================
>
> Bradley Lowekamp
>
> Lockheed Martin Contractor for
>
> Office of High Performance Computing and Communications
>
> National Library of Medicine
>
> blowekamp at mail.nih.gov
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.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
>
>
--
Stephen R. Aylward, Ph.D.
Director of Medical Imaging
Kitware, Inc. - North Carolina Office
http://www.kitware.com
(518) 371-3971 x300 (NY Line)
(919) 969-6990 x300 (NC Line)
stephen.aylward (Skype)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090706/443f1b74/attachment.htm>
More information about the Insight-developers
mailing list