Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next release v2.4.0 #25

Merged
merged 14 commits into from
May 13, 2022
Prev Previous commit
Next Next commit
niftyreg package detection
casperdcl committed May 9, 2022

Verified

This commit was signed with the committer’s verified signature.
casperdcl Casper da Costa-Luis
commit 8b3de3180f7755f036e95953f52ae8da41a0ff2c
1 change: 0 additions & 1 deletion niftypet/nimpa/prc/prc.py
Original file line number Diff line number Diff line change
@@ -727,7 +727,6 @@ def pvc_iyang(
ft1w,
outpath=os.path.join(outpath, 'PET', 'positioning'),
fcomment=fcomment,
executable=Cnt['REGPATH'],
omp=multiprocessing.cpu_count() / 2,
rigOnly=True,
affDirect=False,
26 changes: 15 additions & 11 deletions niftypet/nimpa/prc/regseg.py
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
import os
import shutil
import sys
from os import fspath
from subprocess import call
from textwrap import dedent

@@ -276,7 +277,7 @@ def affine_niftyreg(
fname_aff='',
pickname='ref',
fcomment='',
executable='',
executable=None,
omp=1,
rigOnly=False,
affDirect=False,
@@ -294,10 +295,13 @@ def affine_niftyreg(
fthrsh=0.05,
verbose=True,
):

# check if the executable exists:
if not executable:
executable = getattr(rs, 'REGPATH', None)
if not executable:
from niftyreg import bin_path
executable = fspath(next(bin_path.glob("reg_aladin*")))
if not os.path.isfile(executable):
raise IOError('Incorrect path to executable file for registration.')
raise IOError(f"executable not found:{executable}")

# create a folder for images registered to ref
if outpath != '':
@@ -377,16 +381,16 @@ def resample_niftyreg(
fcomment='',
pickname='ref',
intrp=1,
executable='',
executable=None,
verbose=True,
):

# check if the executable exists:
# if executable=='' and 'RESPATH' in Cnt and os.path.isfile(Cnt['RESPATH']):
# executable = Cnt['RESPATH']

if not executable:
executable = getattr(rs, 'RESPATH', None)
if not executable:
from niftyreg import bin_path
executable = fspath(next(bin_path.glob("reg_resample*")))
if not os.path.isfile(executable):
raise IOError('Incorrect path to executable file for registration.')
raise IOError(f"executable not found:{executable}")

# > output path
if outpath == '' and fimout != '':