Skip to content

Commit

Permalink
testing b0 creation mehtod
Browse files Browse the repository at this point in the history
  • Loading branch information
danielasay committed Jun 25, 2024
1 parent d363cec commit 0e2bfff
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion dwiqc/tasks/prequal.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ def truncate_fmaps(self, fmap_files):
"""
self.get_fsl_sif()

truncated_fmaps = []

for fmap in fmap_files:
fmap_basename = os.path.basename(fmap)
fmap_dir = os.path.dirname(fmap)
print(fmap_dir)
cmd = [
'singularity',
'exec',
Expand All @@ -142,6 +143,22 @@ def truncate_fmaps(self, fmap_files):
]
logger.info(f'running {json.dumps(cmd, indent=2)} on {fmap}')

cmdline = subprocess.list2cmdline(cmd)
logger.info(f'running {cmdline}')
proc = subprocess.Popen(cmdline, shell=True, stdout=subprocess.PIPE)
proc.communicate()
if proc.returncode > 0:
logger.critical(f'fslselectvols command failed')
raise subprocess.CalledProcessError(returncode=proc.returncode, cmd=cmdline)

print(fmap_dir + basename)

truncated_fmaps.append(fmap_dir + fmap_basename)


print(truncated_fmaps)
sys.exit()


def get_fsl_sif(self):

Expand Down

0 comments on commit 0e2bfff

Please sign in to comment.