Commit d7917d30 authored by Lisa Avila's avatar Lisa Avila

BUG: Found a bug in indexing when creating the mix/max volume - space leaping...

BUG: Found a bug in indexing when creating the mix/max volume - space leaping turned back on for all but multiple independent components which still needs some work
parent d77899cd
......@@ -27,7 +27,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeGOHelper, "1.2");
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeGOHelper, "1.3");
vtkStandardNewMacro(vtkFixedPointVolumeRayCastCompositeGOHelper);
// Construct a new vtkFixedPointVolumeRayCastCompositeGOHelper with default values
......@@ -264,7 +264,6 @@ void vtkFixedPointCompositeGOHelperGenerateImageIndependentNN( T *data,
VTKKWRCHelper_InitializationAndLoopStartGONN();
VTKKWRCHelper_InitializeCompositeMultiNN();
VTKKWRCHelper_InitializeCompositeGONN();
VTKKWRCHelper_SpaceLeapSetup();
for ( k = 0; k < numSteps; k++ )
{
......@@ -273,7 +272,6 @@ void vtkFixedPointCompositeGOHelperGenerateImageIndependentNN( T *data,
VTKKWRCHelper_MoveToNextSampleGONN();
}
VTKKWRCHelper_SpaceLeapCheck();
VTKKWRCHelper_CroppingCheckNN( pos );
unsigned char mag[4];
......@@ -682,7 +680,6 @@ void vtkFixedPointCompositeGOHelperGenerateImageIndependentTrilin( T *data,
VTKKWRCHelper_InitializationAndLoopStartGOTrilin();
VTKKWRCHelper_InitializeCompositeMultiTrilin();
VTKKWRCHelper_InitializeCompositeMultiGOTrilin();
VTKKWRCHelper_SpaceLeapSetup();
for ( k = 0; k < numSteps; k++ )
{
......@@ -691,7 +688,6 @@ void vtkFixedPointCompositeGOHelperGenerateImageIndependentTrilin( T *data,
mapper->FixedPointIncrement( pos, dir );
}
VTKKWRCHelper_SpaceLeapCheck();
VTKKWRCHelper_CroppingCheckTrilin( pos );
mapper->ShiftVectorDown( pos, spos );
......
......@@ -27,7 +27,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeGOShadeHelper, "1.2");
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeGOShadeHelper, "1.3");
vtkStandardNewMacro(vtkFixedPointVolumeRayCastCompositeGOShadeHelper);
// Construct a new vtkFixedPointVolumeRayCastCompositeGOShadeHelper with default values
......@@ -279,7 +279,6 @@ void vtkFixedPointCompositeGOShadeHelperGenerateImageIndependentNN( T *data,
VTKKWRCHelper_InitializeCompositeMultiNN();
VTKKWRCHelper_InitializeCompositeShadeNN();
VTKKWRCHelper_InitializeCompositeGONN();
VTKKWRCHelper_SpaceLeapSetup();
for ( k = 0; k < numSteps; k++ )
{
......@@ -288,7 +287,6 @@ void vtkFixedPointCompositeGOShadeHelperGenerateImageIndependentNN( T *data,
VTKKWRCHelper_MoveToNextSampleGOShadeNN();
}
VTKKWRCHelper_SpaceLeapCheck();
VTKKWRCHelper_CroppingCheckNN( pos );
unsigned short normal[4];
unsigned char mag[4];
......@@ -753,7 +751,6 @@ void vtkFixedPointCompositeGOShadeHelperGenerateImageIndependentTrilin( T *data,
VTKKWRCHelper_InitializeCompositeMultiTrilin();
VTKKWRCHelper_InitializeCompositeMultiShadeTrilin();
VTKKWRCHelper_InitializeCompositeMultiGOTrilin();
VTKKWRCHelper_SpaceLeapSetup();
for ( k = 0; k < numSteps; k++ )
{
......@@ -762,7 +759,6 @@ void vtkFixedPointCompositeGOShadeHelperGenerateImageIndependentTrilin( T *data,
mapper->FixedPointIncrement( pos, dir );
}
VTKKWRCHelper_SpaceLeapCheck();
VTKKWRCHelper_CroppingCheckTrilin( pos );
mapper->ShiftVectorDown( pos, spos );
......
......@@ -27,7 +27,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeHelper, "1.2");
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeHelper, "1.3");
vtkStandardNewMacro(vtkFixedPointVolumeRayCastCompositeHelper);
// Construct a new vtkFixedPointVolumeRayCastCompositeHelper with default values
......@@ -256,7 +256,6 @@ void vtkFixedPointCompositeHelperGenerateImageIndependentNN( T *data,
VTKKWRCHelper_InitializeWeights();
VTKKWRCHelper_InitializationAndLoopStartNN();
VTKKWRCHelper_InitializeCompositeMultiNN();
VTKKWRCHelper_SpaceLeapSetup();
for ( k = 0; k < numSteps; k++ )
{
......@@ -265,7 +264,6 @@ void vtkFixedPointCompositeHelperGenerateImageIndependentNN( T *data,
VTKKWRCHelper_MoveToNextSampleNN();
}
VTKKWRCHelper_SpaceLeapCheck();
VTKKWRCHelper_CroppingCheckNN( pos );
for ( c = 0; c < components; c++ )
......@@ -575,7 +573,6 @@ void vtkFixedPointCompositeHelperGenerateImageIndependentTrilin( T *data,
VTKKWRCHelper_InitializeWeights();
VTKKWRCHelper_InitializationAndLoopStartTrilin();
VTKKWRCHelper_InitializeCompositeMultiTrilin();
VTKKWRCHelper_SpaceLeapSetup();
for ( k = 0; k < numSteps; k++ )
{
......@@ -584,7 +581,6 @@ void vtkFixedPointCompositeHelperGenerateImageIndependentTrilin( T *data,
mapper->FixedPointIncrement( pos, dir );
}
VTKKWRCHelper_SpaceLeapCheck();
VTKKWRCHelper_CroppingCheckTrilin( pos );
mapper->ShiftVectorDown( pos, spos );
......
......@@ -27,7 +27,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeShadeHelper, "1.2");
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastCompositeShadeHelper, "1.3");
vtkStandardNewMacro(vtkFixedPointVolumeRayCastCompositeShadeHelper);
// Construct a new vtkFixedPointVolumeRayCastCompositeShadeHelper with default values
......@@ -259,7 +259,6 @@ void vtkFixedPointCompositeShadeHelperGenerateImageIndependentNN( T *data,
VTKKWRCHelper_InitializationAndLoopStartShadeNN();
VTKKWRCHelper_InitializeCompositeMultiNN();
VTKKWRCHelper_InitializeCompositeShadeNN();
VTKKWRCHelper_SpaceLeapSetup();
for ( k = 0; k < numSteps; k++ )
{
......@@ -268,7 +267,6 @@ void vtkFixedPointCompositeShadeHelperGenerateImageIndependentNN( T *data,
VTKKWRCHelper_MoveToNextSampleShadeNN();
}
VTKKWRCHelper_SpaceLeapCheck();
VTKKWRCHelper_CroppingCheckNN( pos );
unsigned short normal[4];
......@@ -630,7 +628,6 @@ void vtkFixedPointCompositeShadeHelperGenerateImageIndependentTrilin( T *data,
VTKKWRCHelper_InitializationAndLoopStartShadeTrilin();
VTKKWRCHelper_InitializeCompositeMultiTrilin();
VTKKWRCHelper_InitializeCompositeMultiShadeTrilin();
VTKKWRCHelper_SpaceLeapSetup();
for ( k = 0; k < numSteps; k++ )
{
......@@ -639,7 +636,6 @@ void vtkFixedPointCompositeShadeHelperGenerateImageIndependentTrilin( T *data,
mapper->FixedPointIncrement( pos, dir );
}
VTKKWRCHelper_SpaceLeapCheck();
VTKKWRCHelper_CroppingCheckTrilin( pos );
mapper->ShiftVectorDown( pos, spos );
......
......@@ -42,7 +42,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastMapper, "1.7");
vtkCxxRevisionMacro(vtkFixedPointVolumeRayCastMapper, "1.8");
vtkStandardNewMacro(vtkFixedPointVolumeRayCastMapper);
// Macro for tri-linear interpolation - do four linear interpolations on
......@@ -91,16 +91,16 @@ void vtkFixedPointVolumeRayCastMapperFillInMinMaxVolume( T *dataPtr, unsigned sh
for ( k = 0; k < fullDim[2]; k++ )
{
sz1 = (k < 2)?(0):(static_cast<int>((k-2)/4));
sz2 = (k < 1)?(0):(static_cast<int>((k-1)/4));
sz1 = (k < 1)?(0):(static_cast<int>((k-1)/4));
sz2 = static_cast<int>((k )/4);
for ( j = 0; j < fullDim[1]; j++ )
{
sy1 = (j < 2)?(0):(static_cast<int>((j-2)/4));
sy2 = (j < 1)?(0):(static_cast<int>((j-1)/4));
sy1 = (j < 1)?(0):(static_cast<int>((j-1)/4));
sy2 = static_cast<int>((j )/4);
for ( i = 0; i < fullDim[0]; i++ )
{
sx1 = (i < 2)?(0):(static_cast<int>((i-2)/4));
sx2 = (i < 1)?(0):(static_cast<int>((i-1)/4));
sx1 = (i < 1)?(0):(static_cast<int>((i-1)/4));
sx2 = static_cast<int>((i )/4);
for ( c = 0; c < smallDim[3]; c++ )
{
......@@ -705,9 +705,7 @@ void vtkFixedPointVolumeRayCastMapper::SetNumberOfThreads( int num )
}
void vtkFixedPointVolumeRayCastMapper::FillInMaxGradientMagnitudes( int fullDim[3],
int smallDim[4],
int independent,
int components )
int smallDim[4] )
{
int i, j, k, c;
int sx1, sx2, sy1, sy2, sz1, sz2;
......@@ -716,33 +714,25 @@ void vtkFixedPointVolumeRayCastMapper::FillInMaxGradientMagnitudes( int fullDim[
for ( k = 0; k < fullDim[2]; k++ )
{
sz1 = (k < 2)?(0):(static_cast<int>((k-2)/4));
sz2 = (k < 1)?(0):(static_cast<int>((k-1)/4));
sz1 = (k < 1)?(0):(static_cast<int>((k-1)/4));
sz2 = static_cast<int>((k )/4);
unsigned char *dptr = this->GradientMagnitude[k];
for ( j = 0; j < fullDim[1]; j++ )
{
sy1 = (j < 2)?(0):(static_cast<int>((j-2)/4));
sy2 = (j < 1)?(0):(static_cast<int>((j-1)/4));
sy1 = (j < 1)?(0):(static_cast<int>((j-1)/4));
sy2 = static_cast<int>((j )/4);
for ( i = 0; i < fullDim[0]; i++ )
{
sx1 = (i < 2)?(0):(static_cast<int>((i-2)/4));
sx2 = (i < 1)?(0):(static_cast<int>((i-1)/4));
sx1 = (i < 1)?(0):(static_cast<int>((i-1)/4));
sx2 = static_cast<int>((i )/4);
for ( c = 0; c < smallDim[3]; c++ )
{
unsigned char val;
if ( independent )
{
val = *dptr;
dptr++;
}
else
{
val = *(dptr+components-1);
dptr += components;
}
val = *dptr;
dptr++;
for ( z = sz1; z <= sz2; z++ )
{
......@@ -825,7 +815,6 @@ void vtkFixedPointVolumeRayCastMapper::UpdateMinMaxVolume( vtkVolume *vol )
return;
}
// Regenerate the min max values if necessary
if ( needToUpdate&0x02 )
{
......@@ -904,7 +893,7 @@ void vtkFixedPointVolumeRayCastMapper::UpdateMinMaxVolume( vtkVolume *vol )
if ( needToUpdate&0x04 )
{
// Now put the gradient magnitude values into the structure
this->FillInMaxGradientMagnitudes( dim, this->MinMaxVolumeSize, independent, components );
this->FillInMaxGradientMagnitudes( dim, this->MinMaxVolumeSize );
// It is OK to use this same variable for scalars and gradient magnitudes - either
// we just rebuilt the min max volume from the scalars, or the MTime on the input
......@@ -952,14 +941,6 @@ void vtkFixedPointVolumeRayCastMapper::UpdateMinMaxVolume( vtkVolume *vol )
{
for ( c = 0; c < this->MinMaxVolumeSize[3]; c++ )
{
if ( !independent )
{
c = components - 1;
}
tmpPtr[2] &= 0xff00;
tmpPtr[2] |= 0x0001;
/***
// We definite have 0 opacity because our maximum scalar value in
// this region is below the minimum scalar value with non-zero opacity
// for this component
......@@ -1013,10 +994,9 @@ void vtkFixedPointVolumeRayCastMapper::UpdateMinMaxVolume( vtkVolume *vol )
zero++;
}
}
***/
tmpPtr += 3;
}
}
}
}
}
......
......@@ -411,9 +411,7 @@ protected:
void UpdateMinMaxVolume( vtkVolume *vol );
void FillInMaxGradientMagnitudes( int fullDim[3],
int smallDim[3],
int independent,
int components );
int smallDim[3] );
private:
vtkFixedPointVolumeRayCastMapper(const vtkFixedPointVolumeRayCastMapper&); // Not implemented.
......@@ -515,7 +513,7 @@ inline int vtkFixedPointVolumeRayCastMapper::CheckMinMaxVolumeFlag( unsigned int
mmpos[1]*this->MinMaxVolumeSize[0] +
mmpos[0] ) + c;
return (*(this->MinMaxVolume + 3*offset + 2)&0x00ff);
return ((*(this->MinMaxVolume + 3*offset + 2))&0x00ff);
}
inline int vtkFixedPointVolumeRayCastMapper::CheckMIPMinMaxVolumeFlag( unsigned int mmpos[3], int c,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment