Atlas Free Slice Alignment ExampleΒΆ
The below cells show an example use case of the atlas-free slice alignment package.
[ ]:
import os
import matplotlib.pyplot as plt
[ ]:
# Location of the script on your local device
script_path = '/home/abenneck/Desktop/atlas_free_slice_alignment/slice_alignment.py'
cmd_str = f'python3 {script_path}'
# Directory where all outputs should be stored
outdir = '/home/abenneck/Desktop/atlas_free_slice_alignment_outputs'
cmd_str += f' {outdir}'
# Directory containing all files to be registered + the relevant fnames
indir = '/home/abenneck/Desktop/atlas_free_slice_alignment/images'
filesmoon=['frame_1_delay-0.2s[1].png','frame_0_delay-0.2s[1].png','frame_0_delay-0.2s[1].png','frame_1_delay-0.2s[1].png','frame_2_delay-0.2s[1].png','frame_3_delay-0.2s[1].png','frame_4_delay-0.2s[1].png','frame_5_delay-0.2s[1].png','frame_6_delay-0.2s[1].png','frame_7_delay-0.2s[1].png','frame_7_delay-0.2s[1].png','frame_6_delay-0.2s[1].png']
cmd_str += ' -fnames'
for fname in filesmoon:
fname = os.path.join(indir, fname)
cmd_str += f' {fname}'
# NOTE: All of the scalar and torch-specific arguments are not included in this example
# Include boolean flag for removing artifacts in input images
cmd_str += ' --remove_artifacts'
# Include boolean flag for saving all figures
cmd_str += ' --saveAllFigs'
print(cmd_str)
os.system(cmd_str)
plt.close('all')