Skip to content

Commit

Permalink
fixed ciftify_recon_all and visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
myousif9 committed Sep 30, 2022
1 parent d6d5b28 commit d944abf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 14 deletions.
2 changes: 1 addition & 1 deletion anat_preproc/config/snakebids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ parse_args:
#singularity containers
singularity:
afni: '/scratch/myousif9/containers/afni_make_build_latest.sif' #'docker://afni/afni_make_build:AFNI_22.2.10'
ciftify: '/scratch/myousif9/containers/ciftify_0.1.sif' #'docker://tigrlab/fmriprep_ciftify:v1.3.2-2.3.3'
ciftify: '/scratch/myousif9/containers/fmriprep_ciftify_v1.3.2-2.3.3.sif' #'docker://tigrlab/fmriprep_ciftify:v1.3.2-2.3.3'
fmriprep: '/scratch/myousif9/containers/fmriprep_22.0.1.sif' #'docker://nipreps/fmriprep:22.0.1'
synthstrip: '/scratch/myousif9/containers/synthstrip.1.1.sif' #'docker://freesurfer/synthstrip:1.2'

52 changes: 39 additions & 13 deletions anat_preproc/workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,11 @@ rule fmriprep:
{params.container} /data {params.fmriprep_outdir} participant --participant_label {wildcards.subject} --skip_bids_validation --skull-strip-t1w skip --anat-only -w /work &> {log}
"""

rule ciftify:
rule ciftify_recon_all:
input:
fmriprep_done = rules.fmriprep.output.done,
fs_license = os.environ['FS_LICENSE'] if config['fs_license'] == False else config['fs_license'],
params:
container = config['singularity']['ciftify'],
freesurfer_dir = bids(
root = 'derivatives/fmriprep/sourcedata',
suffix = 'freesurfer'
Expand All @@ -195,20 +194,38 @@ rule ciftify:
resources:
mem_mb = 16000,
time = 1440
log: bids(root='logs',suffix='ciftify.log',**inputs.input_wildcards['uni'])
log: bids(root='logs',suffix='ciftifyreconall.log',**inputs.input_wildcards['uni'])
shell:
"""
ciftify_recon_all \
--resample-to-T1w32k \
--ciftify-work-dir {params.ciftify_outdir} \
--fs-subjects-dir {params.freesurfer_dir} \
--fs-license {input.fs_license} \
sub-{wildcards.subject} &> {log}
cifti_vis_recon_all subject --ciftify-work-dir {params.ciftify_outdir} sub-{wildcards.subject} &> {log}
cifti_vis_recon_all index --ciftify-work-dir {params.ciftify_outdir} &> {log}
ciftify_recon_all --resample-to-T1w32k --ciftify-work-dir '{params.ciftify_outdir}' --fs-subjects-dir '{params.freesurfer_dir}' --fs-license '{input.fs_license}' --n_cpus '{threads}' 'sub-{wildcards.subject}' &> {log}
cifti_vis_recon_all subject --ciftify-work-dir '{params.ciftify_outdir}' 'sub-{wildcards.subject}' &> {log}
cifti_vis_recon_all index --ciftify-work-dir '{params.ciftify_outdir}' &> {log}
"""

# rule ciftify_viz:
# input:
# ciftify_recon_all_done = rules.ciftify_recon_all.output.done,
# params:
# ciftify_outdir = bids(
# root = 'derivatives',
# suffix = 'ciftify'
# ),
# output:
# done = touch(bids(
# root = 'work',
# suffix = 'ciftifyvis.done',
# **inputs.input_wildcards['uni']
# )),
# container: config['singularity']['ciftify']
# group: 'subj'
# log: bids(root='logs',suffix='ciftifyvis.log',**inputs.input_wildcards['uni'])
# shell:
# """
# cifti_vis_recon_all subject --ciftify-work-dir {params.ciftify_outdir} sub-{wildcards.subject} &> {log}

# cifti_vis_recon_all index --ciftify-work-dir {params.ciftify_outdir} &> {log}
# """

rule all:
input:
expand(
Expand Down Expand Up @@ -237,10 +254,19 @@ rule all:
),
expand(
expand(
rules.ciftify.output.done,
rules.ciftify_recon_all.output.done,
allow_missing=True,
),
zip,
**inputs.input_zip_lists['uni']
),
# expand(
# expand(
# rules.ciftify_viz.output.done,
# allow_missing=True,
# ),
# zip,
# **inputs.input_zip_lists['uni']
# ),

default_target: True

0 comments on commit d944abf

Please sign in to comment.