imageReslice->SetInput( bbGetInputIn() );
imageReslice->SetInformationInput(bbGetInputIn() );
+ double slice=bbGetInputSlice();
+ if (slice<0)
+ {
+ slice=0;
+ }
+
if (bbGetInputTypeOrientation()==3)
{
// Orientation 3 = FREE
bbGetInputResliceAxesDirectionCosines()[5], // v2z
bbGetInputResliceAxesDirectionCosines()[8] // v3z
);
- imageReslice->SetResliceAxesOrigin( bbGetInputSlice()*bbGetInputIn()->GetSpacing()[0] ,0 ,0);
+ imageReslice->SetResliceAxesOrigin( slice*bbGetInputIn()->GetSpacing()[0] ,0 ,0);
} else if (bbGetInputTypeOrientation()==2)
{
// Orientation 2 = YZ
// v3 = [ 0 ,-1 , 0 ]
// SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z);
imageReslice->SetResliceAxesDirectionCosines(0,1,0, 0,0,-1 ,-1,0,0);
- imageReslice->SetResliceAxesOrigin( bbGetInputSlice()*bbGetInputIn()->GetSpacing()[0] ,0 ,0);
+ imageReslice->SetResliceAxesOrigin( slice*bbGetInputIn()->GetSpacing()[0] ,0 ,0);
} else if (bbGetInputTypeOrientation()==1) {
// Orientation 1 = XZ
// v1 = [ 1 , 0 , 0 ]
// v3 = [ 0 ,-1 , 0 ]
// SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z);
imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,0,-1 ,0,1,0);
- imageReslice->SetResliceAxesOrigin(0, bbGetInputSlice()*bbGetInputIn()->GetSpacing()[1],0 );
+ imageReslice->SetResliceAxesOrigin(0, slice*bbGetInputIn()->GetSpacing()[1],0 );
} else
{
// Orientation 0 = XY
// v3 = [ 0 , 0 , 1 ]
// SetResliceAxesDirectionCosines(v1x,v2x,v3x,v1y,v2y,v3y,v1z,v2z,v3z);
imageReslice->SetResliceAxesDirectionCosines(1,0,0, 0,1,0 ,0,0,1);
- imageReslice->SetResliceAxesOrigin(0,0, bbGetInputSlice()*bbGetInputIn()->GetSpacing()[2] );
+ imageReslice->SetResliceAxesOrigin(0,0, slice*bbGetInputIn()->GetSpacing()[2] );
}
imageReslice->SetOutputDimensionality(2);
imageReslice->SetInterpolationModeToLinear();