No subject


Fri May 8 15:29:31 EDT 2009


" ReleaseDataFlag manages the deallocation of a ProcessObject's bulk
output data once that data has been consumed by a downstream
ProcessObject."

In your case, the downstream filter (writer) will release the bulk
data after the Update(). So a reader->GetOutput() should be invalid,
but I think the reader->Update() should regenerate the the reader's
output (and not crash). Looks like a bug to me.

Does it also fail if you do a reader->UpdateLargestPossibleRegion() ?

Others more knowledgeable about the pipeline may comment or correct my
interpretation.

Bill

On Mon, Jun 8, 2009 at 8:50 AM, Ola Kristoffer
=D8ye<ola.kristoffer.oye at cmr.no> wrote:
> Hi,
> I get a crash (access violation) when setting ReleaseDataFlagOn() on a
> tiff reader in ITK, executing the pipeline, and then calling update on
> the reader.
> It could be that I am using the pipeline in some unintended way,
> otherwise I believe it is a bug.
>
> Platform: Win XP 32, VS 2005, ITK 3.14.0.
>
> Below is a basic example that reproduce the problem: a pipeline that
> reads and writes a tiff image, where the reader has ReleaseDataFlagOn():
>
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
>
> void main(int argc, char* argv)
> {
> =A0typedef unsigned short PixelType;
> =A0typedef itk::Image<PixelType, 2> ImageType;
> =A0typedef itk::ImageFileReader<ImageType> Reader;
> =A0typedef itk::ImageFileWriter<ImageType> Writer;
>
> =A0Reader::Pointer reader =3D Reader::New();
> =A0Writer::Pointer writer =3D Writer::New();
>
> =A0reader->ReleaseDataFlagOn(); =A0//this seems to be the problem
> =A0writer->SetInput(reader->GetOutput());
>
> =A0reader->SetFileName("C:\\test\\input.tif");
> =A0writer->SetFileName("C:\\test\\output.tif");
>
> =A0writer->Write();
>
> =A0reader->Update(); =A0//this triggers a crash
> }
>
>
> The crash occurs somewhere inside the tiff reader (stack trace below).
> The file is successfully written.
> Replacing with writer->Update() produces the same crash.
>
> Without ReleaseDataFlagOn(), it works.
> It also works when using a jpg image instead of a tif, even with
> ReleaseDataFlagOn().
>
> I found a similar report from 2004:
> http://www.itk.org/pipermail/insight-users/2004-January/006468.html
>
> Stack trace:
>> =A0 =A0 =A0 GelCorrelation.exe!itk_TIFFRGBAImageOK(tiff * tif=3D0x000000=
00, char
> * emsg=3D0x0013f144) =A0Line 83 + 0x3 bytes C
> =A0 =A0 =A0 =A0GelCorrelation.exe!itk_TIFFReadRGBAImageOriented(tiff *
> tif=3D0x00000000, unsigned long rwidth=3D0, unsigned long rheight=3D0,
> unsigned long * raster=3D0x028dc7d0, int orientation=3D4, int stop=3D1) =
=A0Line
> 468 + 0x10 bytes =A0 =A0 =A0 =A0C
> =A0 =A0 =A0 =A0GelCorrelation.exe!itk_TIFFReadRGBAImage(tiff * tif=3D0x00=
000000,
> unsigned long rwidth=3D0, unsigned long rheight=3D0, unsigned long *
> raster=3D0x028dc7d0, int stop=3D1) =A0Line 490 + 0x1b bytes =A0 C
> =A0 =A0 =A0 =A0GelCorrelation.exe!itk::TIFFImageIO::Read(void *
> buffer=3D0x02af0040) =A0Line 1305 + 0x28 bytes =A0 =A0 =A0C++
> =A0 =A0 =A0 =A0GelCorrelation.exe!itk::ImageFileReader<itk::Image<unsigne=
d
> short,2>,itk::DefaultConvertPixelTraits<unsigned short>
>>::GenerateData() =A0Line 401 + 0x33 bytes =A0 =A0 =A0 =A0C++
>
> GelCorrelation.exe!itk::ProcessObject::UpdateOutputData(itk::DataObject
> * __formal=3D0x028d7f88) =A0Line 987 + 0x12 bytes =A0 C++
> =A0 =A0 =A0 =A0GelCorrelation.exe!itk::DataObject::UpdateOutputData() =A0=
Line 420 +
> 0x21 bytes =A0 =A0 =A0C++
> =A0 =A0 =A0 =A0GelCorrelation.exe!itk::DataObject::Update() =A0Line 344 +=
 0xf bytes
> C++
> =A0 =A0 =A0 =A0GelCorrelation.exe!itk::ProcessObject::Update() =A0Line 61=
5 + 0x1c
> bytes =A0 C++
> =A0 =A0 =A0 =A0GelCorrelation.exe!main(int argc=3D1, char * argv=3D0x027e=
3cb0) =A0Line
> 25 + 0x23 bytes C++
> =A0 =A0 =A0 =A0GelCorrelation.exe!__tmainCRTStartup() =A0Line 597 + 0x19 =
bytes
> C
> =A0 =A0 =A0 =A0GelCorrelation.exe!mainCRTStartup() =A0Line 414 =A0 C
> =A0 =A0 =A0 =A0kernel32.dll!7c817077()
> =A0 =A0 =A0 =A0[Frames below may be incorrect and/or missing, no symbols =
loaded
> for kernel32.dll]
>
>
>
> ----------------------------------------
> Ola Kristoffer =D8ye
> CMR Computing
> Fantoftvegen 38, N-5072 Bergen, Norway
> Phone: +47 55 57 40 04 / +47 41 44 63 53
> Fax: =A0 +47 55 57 40 41
>
>
> _____________________________________
> 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.or=
g/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list