[IGSTK-Users] igstkImageSpatialObject memory management problem
Torleif Sandnes
Torleif.Sandnes at sintef.no
Fri Jun 22 10:12:06 EDT 2007
Hi Luis.
>
> 1) The dataset E000192 fails (with a standard State machine
> transition)
> but *DO NOT CRASHES*. That is, I don't see the bus error that you
> were reporting on June 19th.
Ok, I thought it was an MR dataset. However, what I meant in my
previous post was not that the application crashed in this case:
1. The application crashes on exit only when a dataset has been
loaded successfully. i.e. on exit after loading the MRLiver set.
2. The testapplication I sent with the last post does check for
imageloading success before attaching the spatial object to a
representation! The spatial object is only added if
imageReadyObserver->GotMRImage() returns true. See VolumeManager.cpp
lines 79-96.
This is not be proper statemachine logic, but it should anyway assert
that the imagedata has been loaded before attaching it to a
representation.
>
> What you are seeing as a "silent failure" in this case, is actually
> the proper error management by the State Machine of the reader.
> Namely, if the DICOM dataset cannot be read, the State Machine
> goes to a valid state and emits an event notifying observers that
> the reading action was unsuccessful.
> I would speculate that the bus error in your application is
> the result of not having a properly programmed State Machine
> at the level of the application. More specifically, I would
> suspect that your application is not managing correctly the
> situation in which the Reader can not read the DICOM dataset.
I appreciate this and understand that errorhandling is important. I
was wrong in adressing it as a "silent failure" since the appropriate
error events are sent to my application.
Still, as I explained above, I don't think that is the problem.
>
> Have you added an Observer for the DICOM Error events ?
>
>
> DICOMInvalidRequestErrorEvent
> DICOMImageDirectoryEmptyErrorEvent
> DICOMImageDirectoryDoesNotExistErrorEvent
> DICOMImageDirectoryIsNotDirectoryErrorEvent
> DICOMImageDirectoryDoesNotHaveEnoughFilesErrorEvent
> DICOMImageSeriesFileNamesGeneratingErrorEvent
> DICOMImageReadingErrorEvent
>
>
> Are you converting this event into an input to the state
> machine of your application ?
In the testapplication I sent, I only observe and transduce the
DICOMInvalidRequestErrorEvent and DicomImageReadingErrorEvent. I
should of course observe all these events.
(As as sidenote I find the igstkEventTransductionmacro(event, input)
somewhat cumbersome to use since if I use namespace qualifiers in the
first argument, I get several compiler errors. (Looking at the macro
source I see the reason.) I ended up typedeffing the events instead. )
> If your application is predisposed to the assumption that
> the reading is successful, and it is attempting to use the
> (supposedly) read image, it is to expect that other classes
> will crash down the line (certainly the VTK classes that
> expect to have image data to render...).
I can see that this would have caused problems, but as I explained
above.. :)
> A) I still don't observe any crash in this code
I see consistent crash behaviour when loading the MR dataset.
Thanks,
Torleif
More information about the IGSTK-Users
mailing list