Hi VTK experts,
I have a number of image stacks of which I need to crop a VOI out after I assemble them. I used vtkImageAppend* volumeAppend = vtkImageAppend::New()
to assemble these stacks forming one single volume. Then I used vtkExtractVOI* voi = vtkExtractVOI::New()
to get the VOI I wanted. Once I got the VOI, volumeAppend
became no use anymore and I intended to release the memory held by it. However, calling volumeAppend->Delete()
doesn’t seem to release the memory according to Visual Studio’s diagnostic tool. Moreover, I called volumeAppend->GetOutput()->GetActualMemorySize()
and the return value was the same as it was before volumeAppend->Delete()
. Eventually I found that I could use volumeAppend->ReleaseDataFlagOn()
to free up the memory.
But it left me confused: Why Delete()
doesn’t seem to do the job? Could someone enlighten me a little about some details behind it?
Thanks so much!
PS. To provide a little more context, I used vtkTIFFReader
to read in those stacks, and called volumeAppend->AddInputConnection()
to take vtkTIFFReader’s GetOutputPort()
to assemble the stacks.