Commit 156452ab authored by Cyril Poupon's avatar Cyril Poupon
Browse files

wip on diffeo bug

parent c87e5d53
......@@ -494,9 +494,10 @@ if ( ( options.transformationType == 'affine_and_diffeomorphic' ) or
( options.transformationType == 'diffeomorphic' ) ):
# converting NIFTI direct diffeomorphism to GIS
fileNameDirectNiiDiffeomorphism = fileNameAntsTransform + '1Warp.nii.gz'
fileNameDirectNiiDiffeomorphism = fileNameAntsTransform + \
'1InverseWarp.nii.gz'
fileNameDirectImaDiffeomorphism = os.path.join( intermediateDirectory,
'diffeomorphism_direct.ima' )
'diffeomorphism_direct.ima')
gkg.executeCommand( { 'algorithm' : 'Nifti2GisConverter',
'parameters' : \
{ 'fileNameIn' : fileNameDirectNiiDiffeomorphism,
......@@ -507,11 +508,11 @@ if ( ( options.transformationType == 'affine_and_diffeomorphic' ) or
} )
removeMinf( fileNameDirectImaDiffeomorphism )
# converting NIFTI inverse diffeomorphism to GIS
fileNameInverseNiiDiffeomorphism = fileNameAntsTransform + \
'1InverseWarp.nii.gz'
# converting NIFTI iinverse diffeomorphism to GIS
fileNameInverseNiiDiffeomorphism = fileNameAntsTransform + '1Warp.nii.gz'
fileNameInverseImaDiffeomorphism = os.path.join( intermediateDirectory,
'diffeomorphism_inverse.ima')
'diffeomorphism_inverse.ima' )
gkg.executeCommand( { 'algorithm' : 'Nifti2GisConverter',
'parameters' : \
{ 'fileNameIn' : fileNameInverseNiiDiffeomorphism,
......@@ -522,6 +523,7 @@ if ( ( options.transformationType == 'affine_and_diffeomorphic' ) or
} )
removeMinf( fileNameInverseImaDiffeomorphism )
# extracting dimensions of diffeomorphism
f = open( fileNameDirectImaDiffeomorphism[ : -3 ] + 'dim', 'r' )
lines = f.readlines()
......
......@@ -178,14 +178,38 @@ void gkg::NonLinearTransform3d< T >::getInverse(
_linearTransform3d->getInverse( intermediate, from );
}
else
{
from = intermediate;
}
/*
if ( !_linearTransform3d.isNull() )
{
_linearTransform3d->getInverse( to, intermediate );
}
else
{
intermediate = to;
}
if ( !_vectorFieldTransform3d.isNull() )
{
_vectorFieldTransform3d->getInverse( intermediate, from );
}
*/
}
GKG_CATCH( "template < class T > "
......
......@@ -163,9 +163,9 @@ void gkg::VectorFieldTransform3d< T >::getInverse(
deformation.z,
&_resolution,
5 );
from.x = to.x - deformation.x;
from.y = to.y - deformation.y;
from.z = to.z - deformation.z;
from.x = to.x + deformation.x;
from.y = to.y + deformation.y;
from.z = to.z + deformation.z;
}
GKG_CATCH( "template < class T > "
......
Supports Markdown
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