[Insight-users] ImageFileWriter not throwing exceptions
Luis Ibanez
luis.ibanez at kitware.com
Mon, 26 Jan 2004 15:21:14 -0500
Hi Viet,
That's an interesting functionality to add
to the ImageIO classes. Unfortunately this
will have to be done class by class since
each one of them is very particular.
Most of the ImageIO classes use third party
libraries (png, tiff, jpeg, Meta). We could
certainly add this feature to most of the ImageIO
classes whose full code is in Insight/Code/IO.
It will take a while to have it cleared over
all the platforms....
I would suggest you to enter this issue as
a "feature requrest" in the ITK bug tracker.
You can create yor own account at
http://www.itk.org/Bug/
If you have already modified any ImageIO
writers in order to include this feature
we will be happy to give them a try on
the Dashboard and see how many platforms
support them. (It will be hard to setup
a nightly test for disk full though :-) )
Are you interested in a particular file
format at this point ?
Please let us know if you have further
questions,
Thanks
Luis
--------------------
BUI XUAN Viet wrote:
> Hello everyone,
>
> I use itk ImageFilewriters in my application and realized that
> ImageFilewriter doesn't seem to throw exceptions when writing fails in
> case of insufficient disk space (at least for RawImageIO).
>
> Here's the code that I use:
>
>
>>try {
>> writer->Update ();
>>} catch (itk::ExceptionObject &e) {
>>
>>}
>
>
>
> ITK uses std::ofstream in order to write files, shouldn't it specify the
> type of error on which it should throw exceptions as in:
>
>
>>std::ofstream fp;
>>fp.exceptions (std::ofstream::failbit | std::ofstream::badbit);
>
>
> ?
>
> I may not use the writer properly...
>
> Is there something I should do in order to catch the exception when disk
> space is running out or is there something missing in the implementation
> of the writer?
>
> Regards
>
> Viet
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>