Last active
July 24, 2017 17:09
-
-
Save rherrick/4fbd8b574bfe28c9b38603364b63e22e to your computer and use it in GitHub Desktop.
Create XNAT image reconstruction then update to include manually added files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get a session | |
http --auth admin:minda --session=admin xnat164.xnat.org/data/projects | |
# Create the reconstruction and resource folder | |
http --session=admin PUT xnat164.xnat.org/data/archive/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2/reconstructions/prj001_001_MR2_recon_001 xnat:reconstructedImageData/type==RECON_A | |
http --session=admin PUT xnat164.xnat.org/data/archive/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2/reconstructions/prj001_001_MR2_recon_001/resources/NIFTI format==NIFTI | |
# Upload NIFTI and JSON to the reconstruction resource | |
for SERIES in t1_mpr_1mm_p2_pos50_20061214091206_4 t1_mpr_1mm_p2_pos50_20061214091206_5 t2_spc_1mm_p2_20061214091206_6; do | |
http --session=admin PUT xnat164.xnat.org/data/archive/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2/reconstructions/prj001_001_MR2_recon_001/resources/NIFTI/files/${SERIES}.nii.gz inbody==true < ${SERIES}.nii.gz | |
http --session=admin PUT xnat164.xnat.org/data/archive/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2/reconstructions/prj001_001_MR2_recon_001/resources/NIFTI/files/${SERIES}.json inbody==true < ${SERIES}.json | |
done | |
# Now copy the subfolder into the resource folder on the server side, e.g.: | |
# | |
# cp -R /tmp/logs /data/xnat/archive/prj001/arc001/prj001_001_MR2/PROCESSED/prj001_001_MR2_recon_001/NIFTI | |
# | |
# Then run the refresh script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Refresh the experiment | |
http --session=admin POST xnat164.xnat.org/data/services/refresh/catalog options==populateStats,append,delete,checksum resource==/archive/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2 | |
# Get the resources for the reconstruction | |
http --session=admin xnat164.xnat.org/data/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2/reconstructions/prj001_001_MR2_recon_001/out/resources/NIFTI/files format==json | |
# Just get the absolute paths to the reconstruction resources | |
http --session=admin --pretty=format xnat164.xnat.org/data/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2/reconstructions/prj001_001_MR2_recon_001/out/resources/NIFTI/files format==json locator==absolutePath | fgrep absolutePath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment