Skip to content

Commit

Permalink
Merge pull request #2 from timwahoo/post_processing
Browse files Browse the repository at this point in the history
minor changes to recon
  • Loading branch information
timwahoo authored Feb 1, 2024
2 parents 2b6a194 + 0bca426 commit 1352b90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion brkraw/scripts/brkrecon.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def main():
if len(data.shape) > 3:
output_fname =f"{acqp._parameters['ACQ_scan_name'].strip().replace(' ','_')}"
for c in range(data.shape[4]):
ni_img = nib.Nifti1Image(np.abs(np.squeeze(data)), affine=np.eye(4))
ni_img = nib.Nifti1Image(np.abs(np.squeeze(data[:,:,:,:,c,:,:])), affine=np.eye(4))
nib.save(ni_img, os.path.join(output,f"{acqp._parameters['ACQ_scan_name'].strip().replace(' ','_')}_C{c}.nii.gz"))
print('NifTi file is generated... [{}]'.format(output_fname))
else:
Expand Down
4 changes: 3 additions & 1 deletion tests/recon_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@

# Reconstructed Image Matrix is always 7-dimensional
if len(data.shape) == 7:
print(data.shape)
output_fname =f"{acqp._parameters['ACQ_scan_name'].strip().replace(' ','_')}"

for c in range(data.shape[4]):
ni_img = nib.Nifti1Image(np.abs(np.squeeze(data)), affine=np.eye(4))
ni_img = nib.Nifti1Image(np.abs(np.squeeze(data[:,:,:,:,c,:,:])), affine=np.eye(4))
nib.save(ni_img, os.path.join(output,f"{acqp._parameters['ACQ_scan_name'].strip().replace(' ','_')}_C{c}.nii.gz"))
print('NifTi file is generated... [{}]'.format(output_fname))

0 comments on commit 1352b90

Please sign in to comment.