Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Francesca
Ginkgo
Commits
156452ab
Commit
156452ab
authored
Dec 11, 2019
by
Cyril Poupon
Browse files
wip on diffeo bug
parent
c87e5d53
Changes
3
Hide whitespace changes
Inline
Side-by-side
processing/scripts/AntsRegistration3d/GkgAntsRegistration3d.py
View file @
156452ab
...
...
@@ -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
fileNameI
nverse
NiiD
iffeomorphism
=
fileNameAntsTransform
+
\
'1Inverse
Warp.nii.gz'
# converting NIFTI ii
nverse
d
iffeomorphism
to GIS
fileNameInverseNiiDiffeomorphism
=
fileNameAntsTransform
+
'1
Warp.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
()
...
...
processing/src/library/gkg-processing-transform/NonLinearTransform3d.cxx
View file @
156452ab
...
...
@@ -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 > "
...
...
processing/src/library/gkg-processing-transform/VectorFieldTransform3d.cxx
View file @
156452ab
...
...
@@ -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 > "
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment