[vtkusers] crash during vtkImageMathematics subtraction

Cuypers Wouter Wouter.Cuypers at ua.ac.be
Thu Jun 23 10:02:52 EDT 2005


Hello,
 
I'm trying to subtract two vtkImageData sources but my program always crashes with the following error:
 
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x104ae7ef, pid=992, tid=3628
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode, sharing)
# Problematic frame:
# C  [MSVCP71D.dll+0x2e7ef]
#
....
 
 
Somewhere down the error log I see the stack trace ending at a microsoft visual studio dll:
 
Stack: [0x06e50000,0x06e90000),  sp=0x06e8edc8,  free space=251k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [MSVCP71D.dll+0x2e7ef]
C  [vtkIO.dll+0x165c69]
C  [vtkIO.dll+0x12e627]
C  [vtkIO.dll+0x129c98]
C  [vtkCommon.dll+0x198069]
C  [vtkCommon.dll+0x8f3bc]
C  [vtkCommon.dll+0xe25d4]
C  [vtkCommon.dll+0x197bd6]
C  [vtkCommon.dll+0x8f3bc]
C  [vtkCommon.dll+0xe25d4]
C  [vtkCommon.dll+0x197bd6]
C  [vtkCommon.dll+0x8f3bc]
C  [vtkCommon.dll+0xe25d4]
C  [vtkCommon.dll+0x197c5d]
C  [vtkCommon.dll+0x8f3bc]
C  [vtkCommon.dll+0xe25d4]
C  [vtkCommon.dll+0x197bd6]
C  [vtkCommon.dll+0x8f3bc]
C  [vtkCommon.dll+0xe25d4]
C  [vtkCommon.dll+0x8f0e8]
C  [vtkRendering.dll+0xc38b]
C  [vtkRendering.dll+0xc3e2]
C  [vtkRendering.dll+0x16c847]
C  [vtkRendering.dll+0x128f63]
C  [vtkRendering.dll+0x12930e]
C  [vtkRendering.dll+0x128a86]
C  [vtkRenderingJava.dll+0x478df]
j  vtk.vtkRenderer.GetActiveCamera_27()Lvtk/vtkCamera;+0
j  vtk.vtkRenderer.GetActiveCamera()Lvtk/vtkCamera;+1
j  vtk.vtkPanel.Render()V+47
..........
 
Here's an excerpt of the Java code, I eventually use the output of the ImageMath filter to render a volume, it's during this render that the program fails.
 
/* extract region-of-interest of fMRI volume */
  brainExtract = new vtkExtractVOI();
  brainExtract.SetInput(fMriVolumes[currentTime].getImageReader().GetOutput());
  brainExtract.SetVOI(0, 63, 0, 63, 0, 31);
  brainExtract.SetSampleRate(1, 1, 1);  
  
  /* shift-scale filter for casting the data */
  vtkImageShiftScale ssFilter = new vtkImageShiftScale();
  ssFilter.SetInput(brainExtract.GetOutput());
  ssFilter.SetScale(1.0);
  ssFilter.SetShift(0.0);
  ssFilter.SetOutputScalarTypeToUnsignedChar();
  
  /* extract region-of-interest of average */
  vtkExtractVOI avgExtract = new vtkExtractVOI();
  avgExtract.SetInput(fMriAverage.getImageReader().GetOutput());
  avgExtract.SetVOI(0, 63, 0, 63, 0, 31);
  avgExtract.SetSampleRate(1, 1, 1);  
  
  /* shift-scale filter for casting the data */
  vtkImageShiftScale avgFilter = new vtkImageShiftScale();
  avgFilter.SetInput(avgExtract.GetOutput());
  avgFilter.SetScale(1.0);
  avgFilter.SetShift(0.0);
  avgFilter.SetOutputScalarTypeToUnsignedChar();
  
  /* subtract average from volume */
  vtkImageMathematics math = new vtkImageMathematics();
  math.SetOperationToSubtract();
  math.SetInput1(ssFilter.GetOutput());
  math.SetInput2(avgFilter.GetOutput());
 
Thanks and regards,
 
Wouter Cuypers
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050623/27c9e873/attachment.htm>


More information about the vtkusers mailing list