From 46fc0766c26ab90402cf0b63fcc8a6c3b2781613 Mon Sep 17 00:00:00 2001
From: Fidel Alfaro Almagro <falmagro@fmrib.ox.ac.uk>
Date: Fri, 24 Feb 2023 18:56:25 +0000
Subject: [PATCH] Correcting syntax in IDP scripts

---
 bip/pipelines/IDPs_gen/IDP_SWI_T2star.py      |  8 ++---
 bip/pipelines/IDPs_gen/IDP_T1_FIRST_vols.py   |  4 +--
 .../IDPs_gen/IDP_T1_GM_parcellation.py        |  6 ++--
 bip/pipelines/IDPs_gen/IDP_T1_SIENAX.py       |  5 +--
 bip/pipelines/IDPs_gen/IDP_T1_align_to_std.py | 15 ++++----
 bip/pipelines/IDPs_gen/IDP_T1_noise_ratio.py  |  5 ++-
 bip/pipelines/IDPs_gen/IDP_T2_FLAIR_WMH.py    |  5 ++-
 bip/pipelines/IDPs_gen/IDP_all_align_to_T1.py |  8 ++---
 bip/pipelines/IDPs_gen/IDP_diff_TBSS.py       |  8 ++---
 bip/pipelines/IDPs_gen/IDP_diff_autoPtx.py    |  3 +-
 .../IDPs_gen/IDP_diff_eddy_outliers.py        |  6 ++--
 bip/pipelines/IDPs_gen/IDP_func_TSNR.py       |  4 +--
 .../IDPs_gen/IDP_func_head_motion.py          |  4 +--
 .../IDPs_gen/IDP_func_task_activation.py      | 35 +++++++++----------
 .../IDPs_gen/IDP_subject_COG_table.py         |  6 ++--
 bip/pipelines/IDPs_gen/IDP_subject_ID.py      |  1 +
 bip/pipelines/IDPs_gen/IDP_subject_centre.py  |  5 ++-
 bip/pipelines/IDPs_gen/IDPs_gen.py            |  3 +-
 bip/pipelines/IDPs_gen/IDPs_generator.py      |  4 ++-
 19 files changed, 65 insertions(+), 70 deletions(-)

diff --git a/bip/pipelines/IDPs_gen/IDP_SWI_T2star.py b/bip/pipelines/IDPs_gen/IDP_SWI_T2star.py
index 52d66e1..07fed14 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 d261eb0..f3ddee3 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 e7a9fbe..9e52099 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 05b7813..280594f 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 f6de927..c37f63a 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 82a2921..f557f40 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 fc0089a..9f7bfad 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 f6155d4..bb86360 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 fd2cfd4..5049ca2 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 31b3d40..a31994d 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 02625c4..75f26b2 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 1a88090..61143a0 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 f673831..4fcd30a 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 084d16c..27da52e 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 a9c5503..54fed6c 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 c291f83..aa3ed63 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 fb570d3..d81ec61 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 a084dac..ae8d60a 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 aa81f15..aaf7388 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')
-- 
GitLab