Skip to content

Commit

Permalink
Merge pull request #34 from Medical-Image-Analysis-Laboratory/28_refe…
Browse files Browse the repository at this point in the history
…rence_stack

[ENH] Automatic reference/stacks ordering
  • Loading branch information
pdedumast authored Nov 24, 2020
2 parents e6a8069 + 95fd1c0 commit 730db38
Show file tree
Hide file tree
Showing 12 changed files with 1,077 additions and 458 deletions.
16 changes: 16 additions & 0 deletions .circleci/test-01_outputs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@ nipype/sub-01/rec-1/srr_pipeline/data_sinker/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/data_sinker/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/data_sinker/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/data_sinker/result_data_sinker.pklz
nipype/sub-01/rec-1/srr_pipeline/filenames_gen/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/filenames_gen/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/filenames_gen/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/filenames_gen/result_filenames_gen.pklz
nipype/sub-01/rec-1/srr_pipeline/graph1.json
nipype/sub-01/rec-1/srr_pipeline/graph.dot
nipype/sub-01/rec-1/srr_pipeline/graph.json
nipype/sub-01/rec-1/srr_pipeline/graph.png
nipype/sub-01/rec-1/srr_pipeline/index.html
nipype/sub-01/rec-1/srr_pipeline/masks_filtered/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/masks_filtered/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/masks_filtered/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/masks_filtered/result_masks_filtered.pklz
nipype/sub-01/rec-1/srr_pipeline/nlmDenoise/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/nlmDenoise/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/nlmDenoise/_report/report.rst
Expand Down Expand Up @@ -154,17 +162,25 @@ nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/result_srtkTVSuperResolution.pklz
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/SRTV_sub-01_3V_rad1.json
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/SRTV_sub-01_3V_rad1.nii.gz
nipype/sub-01/rec-1/srr_pipeline/t2ws_filtered/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/t2ws_filtered/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/t2ws_filtered/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/t2ws_filtered/result_t2ws_filtered.pklz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_rec-SDI_id-1_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_rec-SR_id-1_T2w_desc-brain_mask.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_rec-SR_id-1_T2w.json
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_rec-SR_id-1_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-1_id-1_desc-preprocSDI_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-1_id-1_desc-preprocSR_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-1_T2w_desc-brain_mask.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-3_id-1_desc-preprocSDI_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-3_id-1_desc-preprocSR_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-3_T2w_desc-brain_mask.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-5_id-1_desc-preprocSDI_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-5_id-1_desc-preprocSR_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-5_T2w_desc-brain_mask.nii.gz
pymialsrtk-2.0.0b1/sub-01/xfm/sub-01_run-1_id-1_T2w_from-origin_to-SDI_mode-image_xfm.txt
pymialsrtk-2.0.0b1/sub-01/xfm/sub-01_run-3_id-1_T2w_from-origin_to-SDI_mode-image_xfm.txt
pymialsrtk-2.0.0b1/sub-01/xfm/sub-01_run-5_id-1_T2w_from-origin_to-SDI_mode-image_xfm.txt
16 changes: 13 additions & 3 deletions .circleci/test-02_outputs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ nipype/sub-01/rec-1/srr_pipeline/data_sinker/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/data_sinker/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/data_sinker/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/data_sinker/result_data_sinker.pklz
nipype/sub-01/rec-1/srr_pipeline/filenames_gen/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/filenames_gen/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/filenames_gen/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/filenames_gen/result_filenames_gen.pklz
nipype/sub-01/rec-1/srr_pipeline/graph1.json
nipype/sub-01/rec-1/srr_pipeline/graph.dot
nipype/sub-01/rec-1/srr_pipeline/graph.json
nipype/sub-01/rec-1/srr_pipeline/graph.png
nipype/sub-01/rec-1/srr_pipeline/index.html
nipype/sub-01/rec-1/srr_pipeline/masks_filtered/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/masks_filtered/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/masks_filtered/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/masks_filtered/result_masks_filtered.pklz
nipype/sub-01/rec-1/srr_pipeline/Multiple_Brain_extraction/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/Multiple_Brain_extraction/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/Multiple_Brain_extraction/_report/report.rst
Expand Down Expand Up @@ -151,23 +159,25 @@ nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/result_srtkTVSuperResolution.pklz
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/SRTV_sub-01_3V_rad1.json
nipype/sub-01/rec-1/srr_pipeline/srtkTVSuperResolution/SRTV_sub-01_3V_rad1.nii.gz
nipype/sub-01/rec-1/srr_pipeline/t2ws_filtered/_inputs.pklz
nipype/sub-01/rec-1/srr_pipeline/t2ws_filtered/_node.pklz
nipype/sub-01/rec-1/srr_pipeline/t2ws_filtered/_report/report.rst
nipype/sub-01/rec-1/srr_pipeline/t2ws_filtered/result_t2ws_filtered.pklz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_rec-SDI_id-1_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_rec-SR_id-1_T2w_desc-brain_mask.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_rec-SR_id-1_T2w.json
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_rec-SR_id-1_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-1_desc-brain_mask.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-1_id-1_desc-preprocSDI_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-1_id-1_desc-preprocSR_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-2_T2w_brainMask.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-3_desc-brain_mask.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-3_id-1_desc-preprocSDI_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-3_id-1_desc-preprocSR_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-4_T2w_brainMask.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-5_desc-brain_mask.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-5_id-1_desc-preprocSDI_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-5_id-1_desc-preprocSR_T2w.nii.gz
pymialsrtk-2.0.0b1/sub-01/anat/sub-01_run-6_T2w_brainMask.nii.gz
pymialsrtk-2.0.0b1/sub-01/xfm/sub-01_run-1_id-1_T2w_from-origin_to-SDI_mode-image_xfm.txt
pymialsrtk-2.0.0b1/sub-01/xfm/sub-01_run-3_id-1_T2w_from-origin_to-SDI_mode-image_xfm.txt
pymialsrtk-2.0.0b1/sub-01/xfm/sub-01_run-5_id-1_T2w_from-origin_to-SDI_mode-image_xfm.txt
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ dist
data/derivatives/mialsrtk*
data/derivatives/nipype*
data/derivatives/pymialsrtk*
data/derivatives/manual_masks*
data/sub-ctrl*

# Editors #
#####################
.idea/*

9 changes: 5 additions & 4 deletions docker/bidsapp/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def main(bids_dir, output_dir, subject, p_stacksOrder, session, paramTV=None, nu
session <string>
Session ID if applicable (in the form ``ses-YY``)
paramTV dict<'deltatTV': float, 'lambdaTV': float, 'primal_dual_loops': int>>
paramTV dict <'deltatTV': float, 'lambdaTV': float, 'primal_dual_loops': int>>
Dictionary of Total-Variation super-resolution optimizer parameters
number_of_cores <int>
Expand Down Expand Up @@ -236,9 +236,10 @@ def main(bids_dir, output_dir, subject, p_stacksOrder, session, paramTV=None, nu
for sr_params in sr_list:

ses = sr_params["session"] if "session" in sr_params.keys() else None
stacks_order = sr_params['stacksOrder'] if 'stacksOrder' in sr_params.keys() else None

print('sr_params')
if ("stacksOrder" not in sr_params.keys()) or ("sr-id" not in sr_params.keys()):
if ("sr-id" not in sr_params.keys()):
print('Do not process subjects %s because of missing parameters.' % sub)
continue

Expand All @@ -247,7 +248,7 @@ def main(bids_dir, output_dir, subject, p_stacksOrder, session, paramTV=None, nu
res = main(bids_dir=args.bids_dir,
output_dir=args.output_dir,
subject=sub,
p_stacksOrder=sr_params['stacksOrder'],
p_stacksOrder=stacks_order,
session=ses,
paramTV=sr_params['paramTV'],
srID=sr_params['sr-id'],
Expand All @@ -261,7 +262,7 @@ def main(bids_dir, output_dir, subject, p_stacksOrder, session, paramTV=None, nu
res = main(bids_dir=args.bids_dir,
output_dir=args.output_dir,
subject=sub,
p_stacksOrder=sr_params['stacksOrder'],
p_stacksOrder=stacks_order,
session=ses,
srID=sr_params['sr-id'],
use_manual_masks=args.manual,
Expand Down
9 changes: 6 additions & 3 deletions docker/jupyter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ COPY . /app/notebooks

WORKDIR /app/notebooks

RUN printf '#!/bin/bash \n %s && jupyter-notebook --allow-root --no-browser --ip=\"0.0.0.0\" --NotebookApp.token=\'mial\'' "$CONDA_ACTIVATE" > /app/launch_jupyter_notebook.sh
RUN chmod 755 /app/launch_jupyter_notebook.sh
# RUN printf "#!/bin/bash \n %s && jupyter-notebook --allow-root --no-browser --ip=\"0.0.0.0\" --NotebookApp.token=\'mial\'" "$CONDA_ACTIVATE" > /app/launch_jupyter_notebook.sh
RUN printf "#!/bin/bash \n %s && jupyter-lab --allow-root --no-browser --ip=\"0.0.0.0\" --NotebookApp.token=\'mial\'" "$CONDA_ACTIVATE" > /app/launch_jupyter_lab.sh
# RUN chmod 755 /app/launch_jupyter_notebook.sh
RUN chmod 755 /app/launch_jupyter_lab.sh

ENTRYPOINT ["/app/launch_jupyter_notebook.sh"]
# ENTRYPOINT ["/app/launch_jupyter_notebook.sh"]
ENTRYPOINT ["/app/launch_jupyter_lab.sh"]

#ENTRYPOINT ["/opt/mialsuperresolutiontoolkit/run.py"]

Expand Down
2 changes: 1 addition & 1 deletion examples/run_docker_jupyter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data_dir="/home/hkebiri/mialsuperresolutiontoolkit/data"

port=8888

version=v2.0.0-beta-20190906
version=v2.0.0

cmd="docker run --rm"
cmd="$cmd -v "${mialsrtk_dir}/notebooks":/app/notebooks"
Expand Down
Loading

0 comments on commit 730db38

Please sign in to comment.