diff --git a/bip/pipelines/IDPs_gen/IDP_SWI_T2star.py b/bip/pipelines/IDPs_gen/IDP_SWI_T2star.py index 52d66e1acda903d36de6f9d1be1f9cbdffa140db..07fed14c353883122cabe299ea273ef37c4045e1 100755 --- a/bip/pipelines/IDPs_gen/IDP_SWI_T2star.py +++ b/bip/pipelines/IDPs_gen/IDP_SWI_T2star.py @@ -7,10 +7,10 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import os -import json import logging from fsl import wrappers from pipe_tree import In, Out, Ref @@ -20,10 +20,10 @@ log = logging.getLogger(__name__) def run(ctx, T2star_to_T1: In, - T1_first_all_fast_firstseg: In(optional=True), + T1_first_all_fast_firstseg: In(optional=True), logs_dir: Ref, IDP_SWI_T2star: Out): - + with redirect_logging('IDP_SWI_T2star', outdir=logs_dir): result = ("NaN " * 14).strip() @@ -39,4 +39,4 @@ def run(ctx, result = " ".join(result) with open(IDP_SWI_T2star, 'wt', encoding="utf-8") as f: - f.write(f'{result}\n') \ No newline at end of file + f.write(f'{result}\n') diff --git a/bip/pipelines/IDPs_gen/IDP_T1_FIRST_vols.py b/bip/pipelines/IDPs_gen/IDP_T1_FIRST_vols.py index d261eb0a2eda45c575aab30087616774e85a8a8a..f3ddee3e5806ceba1601cbfdfebb2ec815dbbf82 100755 --- a/bip/pipelines/IDPs_gen/IDP_T1_FIRST_vols.py +++ b/bip/pipelines/IDPs_gen/IDP_T1_FIRST_vols.py @@ -7,10 +7,10 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import os -import json import logging from fsl import wrappers from pipe_tree import In, Out, Ref @@ -22,7 +22,7 @@ def run(ctx, T1_first_all_fast_firstseg: In(optional=True), logs_dir: Ref, IDP_T1_FIRST_vols: Out): - + with redirect_logging('IDP_T1_FIRST_vols', outdir=logs_dir): result = ("NaN " * 15).strip() diff --git a/bip/pipelines/IDPs_gen/IDP_T1_GM_parcellation.py b/bip/pipelines/IDPs_gen/IDP_T1_GM_parcellation.py index e7a9fbee47507bd3930d810b3dacae75ed6ac7e2..9e52099d5aa6d2a325767d6e57c8a2a40498fd7f 100755 --- a/bip/pipelines/IDPs_gen/IDP_T1_GM_parcellation.py +++ b/bip/pipelines/IDPs_gen/IDP_T1_GM_parcellation.py @@ -9,8 +9,6 @@ # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 # -import os -import json import logging from fsl import wrappers from pipe_tree import In, Out, Ref @@ -25,14 +23,14 @@ def run(ctx, tmp_dir: Ref, logs_dir: Ref, IDP_T1_GM_parcellation: Out): - + with redirect_logging('IDP_T1_GM_parcellation', outdir=logs_dir),\ tempdir(tmp_dir): result = ("NaN " * 139).strip() GMatlas_to_T1 = tmp_dir + '/GMatlas_to_T1.nii.gz' GMatlas = ctx.get_data("IDPs/GMatlas/GMatlas.nii.gz") - + wrappers.applywarp(src=GMatlas, ref=T1, w=T1_to_MNI_warp_coef_inv, out=GMatlas_to_T1, interp='nn') diff --git a/bip/pipelines/IDPs_gen/IDP_T1_SIENAX.py b/bip/pipelines/IDPs_gen/IDP_T1_SIENAX.py index 05b78132b59e379e8215f6408c9ca5b72606bebd..280594fe69cd578f1db48778fcffcda69a4fc458 100755 --- a/bip/pipelines/IDPs_gen/IDP_T1_SIENAX.py +++ b/bip/pipelines/IDPs_gen/IDP_T1_SIENAX.py @@ -7,11 +7,12 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import os -import json import logging +from shutil import copyfile from pipe_tree import In, Out, Ref from bip.utils.log_utils import redirect_logging @@ -22,7 +23,7 @@ def run(ctx, T1_sienax_txt: Ref, logs_dir: Ref, IDP_T1_SIENAX: Out): - + with redirect_logging('IDP_T1_SIENAX', outdir=logs_dir): result = ("NaN " * 11).strip() diff --git a/bip/pipelines/IDPs_gen/IDP_T1_align_to_std.py b/bip/pipelines/IDPs_gen/IDP_T1_align_to_std.py index f6de92761b7cfe46485ac3dbf6f4adc033f8e5bd..c37f63abaacdf0825ed9ea57ffaf3ed1d51cdba0 100755 --- a/bip/pipelines/IDPs_gen/IDP_T1_align_to_std.py +++ b/bip/pipelines/IDPs_gen/IDP_T1_align_to_std.py @@ -9,7 +9,6 @@ # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 # -import os import logging from fsl import wrappers from pipe_tree import In, Out, Ref @@ -25,25 +24,25 @@ def run(ctx, tmp_dir: Ref, logs_dir: Ref, IDP_T1_align_to_std: Out): - + with redirect_logging('IDP_T1_align_to_std', outdir=logs_dir),\ tempdir(tmp_dir): tmp_jac = tmp_dir + '/tmpjac.nii.gz' - tmp_mat = tmp_dir + '/tmp_mat.mat' + tmp_mat = tmp_dir + '/tmp_mat.mat' MC=ctx.FSLDIR + '/etc/flirtsch/measurecost1.sch' MNI152_T1_1mm_brain = ctx.get_standard("MNI152_T1_1mm_brain.nii.gz") MNI152_T1_1mm_brain_mask = ctx.get_standard("MNI152_T1_1mm_brain_mask.nii.gz") - costs1 = wrappers.flirt(src=T1_brain, ref=MNI152_T1_1mm_brain, - refweight=MNI152_T1_1mm_brain_mask, - init=T1_to_MNI_linear_mat, + costs1 = wrappers.flirt(src=T1_brain, ref=MNI152_T1_1mm_brain, + refweight=MNI152_T1_1mm_brain_mask, + init=T1_to_MNI_linear_mat, schedule=MC, omat=tmp_mat).stdout[0].strip() val1 = costs1.split()[0] - costs2 = wrappers.flirt(src=T1_brain_to_MNI, ref=MNI152_T1_1mm_brain, - refweight=MNI152_T1_1mm_brain_mask, + costs2 = wrappers.flirt(src=T1_brain_to_MNI, ref=MNI152_T1_1mm_brain, + refweight=MNI152_T1_1mm_brain_mask, schedule=MC, omat=tmp_mat).stdout[0].strip() val2 = costs2.split()[0] diff --git a/bip/pipelines/IDPs_gen/IDP_T1_noise_ratio.py b/bip/pipelines/IDPs_gen/IDP_T1_noise_ratio.py index 82a292106a5b6c7fb6f303dcc82ab0f828268de8..f557f409604e88d306c42da03b1f7b8eee4f7303 100755 --- a/bip/pipelines/IDPs_gen/IDP_T1_noise_ratio.py +++ b/bip/pipelines/IDPs_gen/IDP_T1_noise_ratio.py @@ -7,10 +7,9 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # -import os -import json import logging from fsl import wrappers from pipe_tree import In, Out, Ref @@ -24,7 +23,7 @@ def run(ctx, tmp_dir: Ref, logs_dir: Ref, IDP_T1_noise_ratio: Out): - + with redirect_logging('IDP_T1_noise_ratio', outdir=logs_dir),\ tempdir(tmp_dir): diff --git a/bip/pipelines/IDPs_gen/IDP_T2_FLAIR_WMH.py b/bip/pipelines/IDPs_gen/IDP_T2_FLAIR_WMH.py index fc0089a64e8003d0b29a733c7df181af100a34ee..9f7bfad173eec7eb42c4ef050af232cd6a6e966f 100755 --- a/bip/pipelines/IDPs_gen/IDP_T2_FLAIR_WMH.py +++ b/bip/pipelines/IDPs_gen/IDP_T2_FLAIR_WMH.py @@ -7,10 +7,9 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # -import os -import json import logging from shutil import copyfile from pipe_tree import In, Out, Ref @@ -22,6 +21,6 @@ def run(ctx, T2_FLAIR_bianca_volume: In, logs_dir: Ref, IDP_T2_FLAIR_WMH: Out): - + with redirect_logging('IDP_T2_FLAIR_WMH', outdir=logs_dir): copyfile(src=T2_FLAIR_bianca_volume, dst=IDP_T2_FLAIR_WMH) diff --git a/bip/pipelines/IDPs_gen/IDP_all_align_to_T1.py b/bip/pipelines/IDPs_gen/IDP_all_align_to_T1.py index f6155d40bee383a79afbfdc0ac91a6339c2bb164..bb86360760f33777333172e7fa6f993a76f3712e 100755 --- a/bip/pipelines/IDPs_gen/IDP_all_align_to_T1.py +++ b/bip/pipelines/IDPs_gen/IDP_all_align_to_T1.py @@ -32,18 +32,18 @@ def run(ctx, with redirect_logging('IDP_all_align_to_T1', outdir=logs_dir),\ tempdir(tmp_dir): - tmp_mat = tmp_dir + '/tmp_mat.mat' + tmp_mat = tmp_dir + '/tmp_mat.mat' result="" MC=ctx.FSLDIR + '/etc/flirtsch/measurecost1.sch' - for file_name in [T2_FLAIR_brain, fieldmap_iout_to_T1, SWI_to_T1, + for file_name in [T2_FLAIR_brain, fieldmap_iout_to_T1, SWI_to_T1, rfMRI_example_func2highres,tfMRI_example_func2highres]: if os.path.exists(file_name): - costs1 = wrappers.flirt(src=file_name, ref=T1_brain, - refweight=T1_brain_mask, schedule=MC, + costs1 = wrappers.flirt(src=file_name, ref=T1_brain, + refweight=T1_brain_mask, schedule=MC, omat=tmp_mat).stdout[0].strip() result += " " + str(costs1.split()[0]) else: diff --git a/bip/pipelines/IDPs_gen/IDP_diff_TBSS.py b/bip/pipelines/IDPs_gen/IDP_diff_TBSS.py index fd2cfd450a50c8c131a84b51d88ae0085edc8701..5049ca2842660de75fbb775afcc655e2b103ec94 100755 --- a/bip/pipelines/IDPs_gen/IDP_diff_TBSS.py +++ b/bip/pipelines/IDPs_gen/IDP_diff_TBSS.py @@ -1,16 +1,16 @@ #!/usr/bin/env python # -# IDP_diff_TBSS.py - Generating IDP file with TBSS metrics +# IDP_diff_TBSS.py - Generating IDP file with TBSS metrics # # Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk> # Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import os -import json import logging from pipe_tree import In, Out, Ref from bip.utils.log_utils import redirect_logging @@ -22,7 +22,7 @@ def run(ctx, logs_dir: Ref, JHUrois_prefix: Ref, IDP_diff_TBSS: Out): - + with redirect_logging('IDP_diff_TBSS', outdir=logs_dir): nan_result = ("NaN " * 48).strip() @@ -34,7 +34,7 @@ def run(ctx, file_name = JHUrois_prefix + mod + ".txt" print(file_name) if os.path.exists(file_name): - with open(file_name, "r") as f: + with open(file_name, "r", encoding="utf-8") as f: mini_result = f.read() mini_result = mini_result.replace("\n", " ") mini_result = mini_result.replace(" ", " ") diff --git a/bip/pipelines/IDPs_gen/IDP_diff_autoPtx.py b/bip/pipelines/IDPs_gen/IDP_diff_autoPtx.py index 31b3d4092155dd263c9b5486c6ee0c69cbc013b3..a31994db9cc8b018ef19e33ba3cbc2051fb0d559 100755 --- a/bip/pipelines/IDPs_gen/IDP_diff_autoPtx.py +++ b/bip/pipelines/IDPs_gen/IDP_diff_autoPtx.py @@ -7,13 +7,14 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import os import logging import nibabel as nib from fsl import wrappers -from pipe_tree import In, Out, Ref, Var +from pipe_tree import In, Out, Ref from bip.utils.log_utils import redirect_logging, tempdir log = logging.getLogger(__name__) diff --git a/bip/pipelines/IDPs_gen/IDP_diff_eddy_outliers.py b/bip/pipelines/IDPs_gen/IDP_diff_eddy_outliers.py index 02625c4a40d8962515ffd122005e0410d09ce9a1..75f26b2bbce8f4ae6ed38a01729206e19266d924 100755 --- a/bip/pipelines/IDPs_gen/IDP_diff_eddy_outliers.py +++ b/bip/pipelines/IDPs_gen/IDP_diff_eddy_outliers.py @@ -1,16 +1,16 @@ #!/usr/bin/env python # -# IDP_diff_eddy_outliers.py - Generating IDP file with eddy outliers metrics +# IDP_diff_eddy_outliers.py - Generating IDP file with eddy outliers metrics # # Author: Fidel Alfaro Almagro <fidel.alfaroalmagro@ndcn.ox.ac.uk> # Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import os -import json import logging from pipe_tree import In, Out, Ref from bip.utils.log_utils import redirect_logging @@ -21,7 +21,7 @@ def run(ctx, eddy_outlier_report: In(optional=True), logs_dir: Ref, IDP_diff_eddy_outliers: Out): - + with redirect_logging('IDP_diff_eddy_outliers', outdir=logs_dir): num_outliers = 0 diff --git a/bip/pipelines/IDPs_gen/IDP_func_TSNR.py b/bip/pipelines/IDPs_gen/IDP_func_TSNR.py index 1a880908518933be8aa996f6f8441fdf99c5103c..61143a055971ef213dff6bc3951b18362a2e2822 100755 --- a/bip/pipelines/IDPs_gen/IDP_func_TSNR.py +++ b/bip/pipelines/IDPs_gen/IDP_func_TSNR.py @@ -7,10 +7,10 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import os -import json import logging from fsl import wrappers from pipe_tree import In, Out, Ref @@ -25,7 +25,7 @@ def run(ctx, logs_dir: Ref, tmp_dir: Ref, IDP_func_TSNR: Out): - + with redirect_logging('IDP_func_TSNR', outdir=logs_dir),\ tempdir(tmp_dir): diff --git a/bip/pipelines/IDPs_gen/IDP_func_head_motion.py b/bip/pipelines/IDPs_gen/IDP_func_head_motion.py index f673831b7b703fd7a5de4f7852cb2db3fa9e7c50..4fcd30a5e940496124fac9d12ae89d41389a3b70 100755 --- a/bip/pipelines/IDPs_gen/IDP_func_head_motion.py +++ b/bip/pipelines/IDPs_gen/IDP_func_head_motion.py @@ -7,6 +7,7 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import os @@ -22,9 +23,8 @@ def run(ctx, tfMRI_mc_rel_mean: In(optional=True), logs_dir: Ref, IDP_func_head_motion: Out): - + with redirect_logging('IDP_func_head_motion', outdir=logs_dir): - result="" if os.path.exists(rfMRI_mc_rel_mean): with open(rfMRI_mc_rel_mean, "r", encoding="utf-8") as f: diff --git a/bip/pipelines/IDPs_gen/IDP_func_task_activation.py b/bip/pipelines/IDPs_gen/IDP_func_task_activation.py index 084d16c9a35043e6dbb590c88e05687cbb126d12..27da52e57324f75f99a7b97823506aadd0004405 100755 --- a/bip/pipelines/IDPs_gen/IDP_func_task_activation.py +++ b/bip/pipelines/IDPs_gen/IDP_func_task_activation.py @@ -10,7 +10,6 @@ # import os -import json import shutil import logging from fsl import wrappers @@ -41,10 +40,10 @@ def run(ctx, tfMRI_featquery_5_report: Out, tfMRI_featquery_5a_report: Out, IDP_func_task_activation: Out): - + with redirect_logging('IDP_func_task_activation', outdir=logs_dir): if not os.path.exists(highres2standard_warp): - os.symlink(src=os.getcwd() + "/" + T1_to_MNI_warp, + os.symlink(src=os.getcwd() + "/" + T1_to_MNI_warp, dst=highres2standard_warp) if not os.path.exists(highres2standard_warp_inv): @@ -77,27 +76,27 @@ def run(ctx, N_tfMRI_featquery_5a_dir = tfMRI_featquery_5a_dir.replace(tfMRI_feat,"") - wrappers.featquery(N_featdirs="1", featdir1=tfMRI_feat, N_stats="2", - stats1=[N_tfMRI_cope1, N_tfMRI_zstat1], - outputRootName=N_tfMRI_featquery_1_dir, + wrappers.featquery(N_featdirs="1", featdir1=tfMRI_feat, N_stats="2", + stats1=[N_tfMRI_cope1, N_tfMRI_zstat1], + outputRootName=N_tfMRI_featquery_1_dir, mask=group_mask_1) - wrappers.featquery(N_featdirs="1", featdir1=tfMRI_feat, N_stats="2", - stats1=[N_tfMRI_cope2, N_tfMRI_zstat2], - outputRootName=N_tfMRI_featquery_2_dir, + wrappers.featquery(N_featdirs="1", featdir1=tfMRI_feat, N_stats="2", + stats1=[N_tfMRI_cope2, N_tfMRI_zstat2], + outputRootName=N_tfMRI_featquery_2_dir, mask=group_mask_2) - wrappers.featquery(N_featdirs="1", featdir1=tfMRI_feat, N_stats="2", - stats1=[N_tfMRI_cope5, N_tfMRI_zstat5], - outputRootName=N_tfMRI_featquery_5_dir, + wrappers.featquery(N_featdirs="1", featdir1=tfMRI_feat, N_stats="2", + stats1=[N_tfMRI_cope5, N_tfMRI_zstat5], + outputRootName=N_tfMRI_featquery_5_dir, mask=group_mask_5) - wrappers.featquery(N_featdirs="1", featdir1=tfMRI_feat, N_stats="2", - stats1=[N_tfMRI_cope5, N_tfMRI_zstat5], - outputRootName=N_tfMRI_featquery_5a_dir, + wrappers.featquery(N_featdirs="1", featdir1=tfMRI_feat, N_stats="2", + stats1=[N_tfMRI_cope5, N_tfMRI_zstat5], + outputRootName=N_tfMRI_featquery_5a_dir, mask=group_mask_5a) - result="" - + result="" + for file_name in [tfMRI_featquery_1_report, tfMRI_featquery_2_report, - tfMRI_featquery_5_report, tfMRI_featquery_5a_report]: + tfMRI_featquery_5_report, tfMRI_featquery_5a_report]: with open(file_name, "r", encoding="utf-8") as f: report = f.readlines() diff --git a/bip/pipelines/IDPs_gen/IDP_subject_COG_table.py b/bip/pipelines/IDPs_gen/IDP_subject_COG_table.py index a9c5503d716635d8a21284cdfecc378156cba487..54fed6c2edfe233432c5d2121fdb81aed0704029 100755 --- a/bip/pipelines/IDPs_gen/IDP_subject_COG_table.py +++ b/bip/pipelines/IDPs_gen/IDP_subject_COG_table.py @@ -7,10 +7,10 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import os -import json import logging from pipe_tree import In, Out, Ref from bip.utils.log_utils import redirect_logging @@ -18,7 +18,6 @@ from bip.utils.log_utils import redirect_logging log = logging.getLogger(__name__) def run(ctx, - T1_orig: In, T1_QC_COG: In, T1_dcm_txt: In, dMRI_dcm_txt: Ref, @@ -31,14 +30,13 @@ def run(ctx, with redirect_logging('IDP_subject_COG_table', outdir=logs_dir): - result = "" with open(T1_QC_COG, "r", encoding="utf-8") as f: COG = f.read().strip() table = "NaN" table_text = "(0019, 1012) [TablePositionOrigin]" - for file_name in [T1_dcm_txt, T2_dcm_txt, rfMRI_dcm_txt, SWI_dcm_txt, + for file_name in [T1_dcm_txt, T2_dcm_txt, rfMRI_dcm_txt, SWI_dcm_txt, dMRI_dcm_txt, tfMRI_dcm_txt]: if os.path.exists(file_name): diff --git a/bip/pipelines/IDPs_gen/IDP_subject_ID.py b/bip/pipelines/IDPs_gen/IDP_subject_ID.py index c291f8303a4072adc33a725afae1eb3961e372f4..aa3ed635b56fb38a99dcfb18be2ae105d6ddc44e 100755 --- a/bip/pipelines/IDPs_gen/IDP_subject_ID.py +++ b/bip/pipelines/IDPs_gen/IDP_subject_ID.py @@ -7,6 +7,7 @@ # Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # # pylint: disable=C0103,E0602,C0114,C0115,C0116,R0913,R0914,R0915 +# pylint: disable=W0613 # import logging diff --git a/bip/pipelines/IDPs_gen/IDP_subject_centre.py b/bip/pipelines/IDPs_gen/IDP_subject_centre.py index fb570d3272575a282bdc1f944acc7276e30f4ca0..d81ec6182dfedddb34173e2aa39fd41a5d93d584 100755 --- a/bip/pipelines/IDPs_gen/IDP_subject_centre.py +++ b/bip/pipelines/IDPs_gen/IDP_subject_centre.py @@ -18,7 +18,6 @@ from bip.utils.log_utils import redirect_logging log = logging.getLogger(__name__) def run(ctx, - T1_orig: In, T1_dcm_txt: In, dMRI_dcm_txt: Ref, rfMRI_dcm_txt: Ref, @@ -27,13 +26,13 @@ def run(ctx, tfMRI_dcm_txt: Ref, logs_dir: Ref, IDP_subject_centre: Out): - + with redirect_logging('IDP_subject_centre', outdir=logs_dir): line = "" address_text = "(0008, 0081) Institution Address" - for file_name in [T1_dcm_txt, T2_dcm_txt, rfMRI_dcm_txt, SWI_dcm_txt, + for file_name in [T1_dcm_txt, T2_dcm_txt, rfMRI_dcm_txt, SWI_dcm_txt, dMRI_dcm_txt, tfMRI_dcm_txt]: if os.path.exists(file_name): diff --git a/bip/pipelines/IDPs_gen/IDPs_gen.py b/bip/pipelines/IDPs_gen/IDPs_gen.py index a084dace628d6b2571e4d183dc7034c3d19853fe..ae8d60abbd87b750998ad00b224f55046c65aba8 100755 --- a/bip/pipelines/IDPs_gen/IDPs_gen.py +++ b/bip/pipelines/IDPs_gen/IDPs_gen.py @@ -18,7 +18,6 @@ from bip.pipelines.IDPs_gen import IDP_all_align_to_T1 from bip.pipelines.IDPs_gen import IDP_T1_FIRST_vols from bip.pipelines.IDPs_gen import IDP_T1_SIENAX from bip.pipelines.IDPs_gen import IDP_T1_GM_parcellation -from bip.pipelines.IDPs_gen import IDP_T1_SIENAX from bip.pipelines.IDPs_gen import IDP_T1_align_to_std from bip.pipelines.IDPs_gen import IDP_T1_noise_ratio from bip.pipelines.IDPs_gen import IDP_T2_FLAIR_WMH @@ -37,7 +36,7 @@ def add_to_pipeline(ctx, pipe, tree, targets): logs_dir=tree.get('logs_dir') - subj = ctx.subject + subj = ctx.subject with redirect_logging('pipe_IDPs_gen', outdir=logs_dir): pipe(IDP_subject_ID.run, diff --git a/bip/pipelines/IDPs_gen/IDPs_generator.py b/bip/pipelines/IDPs_gen/IDPs_generator.py index aa81f15baff7780f513bb42d40125f709ca8af95..aaf738864cea47cd6fbb9c8ac3d8a9738c19fe6a 100755 --- a/bip/pipelines/IDPs_gen/IDPs_generator.py +++ b/bip/pipelines/IDPs_gen/IDPs_generator.py @@ -70,5 +70,7 @@ def run(ctx, result = result.replace(" ", " ").strip() - with open(IDP_diff_autoPtx, 'wt', encoding="utf-8") as f: + print(result) + + with open(IDPs, 'wt', encoding="utf-8") as f: f.write(f'{result}\n')