[vtkusers] Crash with FixedPointVolumeRayCastMapper
Lisa Avila
lisa.avila at kitware.com
Wed May 18 15:03:24 EDT 2005
Hi Antoine,
I changed the standard SimpleRayCast.tcl example in
VTK/Examples/VolumeRendering/Tcl over to use the fixed point ray caster. I
added a vtkImageShiftScale, a vtkImageResamples and a
vtkImageChangeInformation to change the data to 512x512x51 floats with a
spacing of 4.6875, 4.6875, 15. I also tried unsigned char data type. I
cannot reproduce the crash. Can you try something similar on your end? That
is - take one of the standard VTK data sets, make it the size/spacing/data
type you are having problems with, and see if you encounter the crash?
I attached the code I used below if you want to test using Tcl.
Thanks!
Lisa
package require vtk
package require vtkinteraction
# Create the standard renderer, render window
# and interactor
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
# Create the reader for the data
vtkStructuredPointsReader reader
reader SetFileName "$VTK_DATA_ROOT/Data/ironProt.vtk"
vtkImageShiftScale ss
ss SetInput [reader GetOutput]
ss SetOutputScalarTypeToFloat
ss SetShift 0
ss SetScale 1
vtkImageResample resample
resample SetInput [ss GetOutput]
resample SetAxisMagnificationFactor 0 [expr 511.5/67.0]
resample SetAxisMagnificationFactor 1 [expr 511.5/67.0]
resample SetAxisMagnificationFactor 2 [expr 50.5/67.0]
resample Update
vtkImageChangeInformation ci
ci SetInput [resample GetOutput]
ci SetOutputSpacing 4.6875 4.6875 15
ci Update
# Create transfer mapping scalar value to opacity
vtkPiecewiseFunction opacityTransferFunction
opacityTransferFunction AddPoint 20 0.0
opacityTransferFunction AddPoint 255 0.2
# Create transfer mapping scalar value to color
vtkColorTransferFunction colorTransferFunction
colorTransferFunction AddRGBPoint 0.0 0.0 0.0 0.0
colorTransferFunction AddRGBPoint 64.0 1.0 0.0 0.0
colorTransferFunction AddRGBPoint 128.0 0.0 0.0 1.0
colorTransferFunction AddRGBPoint 192.0 0.0 1.0 0.0
colorTransferFunction AddRGBPoint 255.0 0.0 0.2 0.0
# The property describes how the data will look
vtkVolumeProperty volumeProperty
volumeProperty SetColor colorTransferFunction
volumeProperty SetScalarOpacity opacityTransferFunction
volumeProperty ShadeOn
volumeProperty SetInterpolationTypeToLinear
# The mapper / ray cast function know how to render the data
vtkFixedPointVolumeRayCastMapper volumeMapper
volumeMapper SetInput [ci GetOutput]
# The volume holds the mapper and the property and
# can be used to position/orient the volume
vtkVolume volume
volume SetMapper volumeMapper
volume SetProperty volumeProperty
ren1 AddVolume volume
ren1 SetBackground 1 1 1
renWin SetSize 600 600
renWin Render
proc TkCheckAbort {} {
set foo [renWin GetEventPending]
if {$foo != 0} {renWin SetAbortRender 1}
}
renWin AddObserver AbortCheckEvent {TkCheckAbort}
iren AddObserver UserEvent {wm deiconify .vtkInteract}
iren Initialize
wm withdraw .
At 05:19 PM 5/16/2005, Antoine Rosset wrote:
>Program received signal EXC_BAD_ACCESS, Could not access memory.
>Reason: KERN_INVALID_ADDRESS at address: 0xce9f6917
>[Switching to process 8764 thread 0x88fb]
>0x0063e200 in
>vtkFixedPointCompositeShadeHelperGenerateImageOneTrilin<float> ()
>
>#0 0x0063e200 in
>vtkFixedPointCompositeShadeHelperGenerateImageOneTrilin<float> ()
>#1 0x0028e4c4 in
>vtkFixedPointVolumeRayCastCompositeShadeHelper::GenerateImage ()
>#2 0x001bd8b4 in FixedPointVolumeRayCastMapper_CastRays ()
>#3 0x9002c3b4 in _pthread_body ()
>
>With : reader->SetDataSpacing( 4.6875, 4.6875, 15)
>
>Sincerely,
>
>Antoine Rosset
>
><> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <><> <>
><> OSIRIX: Next Generation DICOM Viewer
><> http://homepage.mac.com/rossetantoine/osirix
><>
><> Antoine ROSSET, M.D. (RossetAntoine at bluewin.ch)
><> Blog : http://rossetantoine.blogspot.com/
><> Geneva University Hospital - Radiology Department
><> 20 Micheli-Du-Crest, CH-1205 Geneva
><> Switzerland, Europe
><> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <><> <>
>
>
>On May 16, 2005, at 3:36 PM, Mathieu Malaterre wrote:
>
>>Antoine,
>>
>> Your feedback definitely narrows down the parameters, but it
>>would be even more usefull if you could send us the backtrace of
>>the crash. I'll assume you are running osirix compiled in Debug
>>mode for that. Simply do:
>>
>>
>>$ gdb osirix
>>(gdb) run
>>
>>... reload your usual volume ...
>>when your program hangs then simply do:
>>
>>(gdb) bt
>>
>>Thanks a lot
>>Mathieu
>>
>>
>>Antoine Rosset wrote:
>>
>>>Hi,
>>>Yes, this crash occurs repeatedly when I rotate the object:
>>>suddenly it crashes at a specific angle. It seems the function
>>>try to access something outside the data memory zone.
>>>Here are the parameters:
>>>- float and unsigned char data (data is 512 x 512 x 51)
>>>- 1 or 4 components
>>>- with or without shading
>>>- with or without linear opacity function
>>>The crashes are not influenced by these parameters.
>>>If I replace the vtkFixedPointVolumeRayCastMapper function by
>>>vtkVolumeRayCastMapper function, the crashes completely disappear.
>>>BUT: if I change the reader->SetDataSpacing( 0.46875, 0.46875,
>>>1.5) function to reader->SetDataSpacing( 1, 1, 1); the crashes
>>>DISAPPEAR.
>>>The library is compiled under MacOS X 10.4, dual-G5, 2 GB of RAM.
>>>BTW: This new function accelerate renderings by a factor from 4 to
>>>8 on dual-PowerPC systems compared to vtkVolumeRayCastMapper.
>>>And thanks for the new RGB support!
>>>Sincerely,
>>>Antoine Rosset
>>><> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <><> <>
>>><> OSIRIX: Next Generation DICOM Viewer
>>><> http://homepage.mac.com/rossetantoine/osirix
>>><>
>>><> Antoine ROSSET, M.D. (RossetAntoine at bluewin.ch)
>>><> Blog : http://rossetantoine.blogspot.com/
>>><> Geneva University Hospital - Radiology Department
>>><> 20 Micheli-Du-Crest, CH-1205 Geneva
>>><> Switzerland, Europe
>>><> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <><> <>
>>>On May 16, 2005, at 6:09 AM, Lisa Avila wrote:
>>>
>>>>Hi Antoine,
>>>>
>>>>If you have some way of repeatedly causing the crash, I would
>>>>love to hear about it. Also, can you describe the type of data
>>>>you are rendering (data type and number of components, along
>>>>with the options you've selected such as MIP vs. composite, was
>>>>shading on? Is the gradient opacity function not a constant 1?),
>>>>and your system?
>>>>
>>>>Thanks,
>>>>
>>>>Lisa
>>>_______________________________________________
>>>This is the private VTK discussion list. Please keep messages on- topic.
>>>Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>Follow this link to subscribe/unsubscribe:
>>>http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>_______________________________________________
>This is the private VTK discussion list. Please keep messages on-topic.
>Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list