[vtkusers] Scalar Range problem

Matthieu Ferrant ferrant at tele.ucl.ac.be
Thu Jul 19 08:28:52 EDT 2001


Response to my earlier posting :

I found a way to avoid the scalar range being computed only on the part
of the image which is used by the pipeline : AllocateScalars()
e.g. to obtain the scalar range on an entire image volume :
myImageData AllocateScalars
set range [myImageData GetScalarRange]

It seems that vtk is releasing the memory of the scalars to those
associated to the chunks of the data that are being used by the
pipeline.

matt

Matthieu Ferrant wrote:
> 
> Hi,
> 
> I am encountering an unwanted behavior of GetScalarRange on
> vtkImageData.
> 
> When I read in imagedata and call an update so the entire image is in
> memory, GetScalarRange performs normally. After having used the
> imageData for some other viewing purposes as input to other filters,
> GetScalarRange fails and outputs a different scalar range ...
> 
> To check what was going on at the level of the scalars associated to the
> image, I added a print in the ComputeRange method of vtkScalars to
> output the number of scalars at each call :
> - first call (after imageReader update) : 126976 (normal : 64*64*31
> voxels)
> - second call (no other calls, no modifications to image ,it has just
> been passed as input to other filters) : 1984 (31*64, just a slice), so
> it seems it has computed the scalar range on a slice the image viewer
> used before the call to ComputeRange. Apparently, the entire image does
> not stay in memory, because when I call GetActualMemorySize it goes down
> from 127 kbytes to 2kbytes, which is the size of a slice.
> 
> How can I prevent this from happening, and keep the entire image stored
> in memory so that if I call GetScalarRange, it keeps giving me the same
> range ?
> 
> Thanks,
> 
> matt
> 
> --
> M.Ferrant, Ph.D.
> UCL/TELE Room A-157 Place du Levant, 2 B-1348LLN - Belgium
> Tel. +32-10-478073 Fax. : +32-10-472089
> http://www.tele.ucl.ac.be/MEMBERS/Ferrant_Matthieu_e.html
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

-- 
M.Ferrant, Ph.D.
UCL/TELE Room A-157 Place du Levant, 2 B-1348LLN - Belgium
Tel. +32-10-478073 Fax. : +32-10-472089
http://www.tele.ucl.ac.be/MEMBERS/Ferrant_Matthieu_e.html




More information about the vtkusers mailing list