ソースを参照

Having preprocess.py sensitive to needsResampling flag in Imaging1 dataset

Andrej Studen 5 ヶ月 前
コミット
4ac0852fb0
1 ファイル変更8 行追加2 行削除
  1. 8 2
      pythonScripts/preprocess.py

+ 8 - 2
pythonScripts/preprocess.py

@@ -156,7 +156,6 @@ def main(parameterFile):
         seqNo=row['SequenceNum']
         print("Starting row id:{} seq:{}".format(pId,seqNo))
 
-
         #interesting files are processedDir/studyName_CT_notCropped_2mmVoxel.nii
         #asn processedDir/studyName_PET_notCropped_2mmVoxel.nii
         volumeFileNames={im:\
@@ -179,8 +178,15 @@ def main(parameterFile):
         for f in gzRemoteFiles.values():
             print("[{}]: [{}]".format(f,fb.entryExists(f)))
 
+        #force preprocessing if needsResampling is set to true
+        overloadFlag='needsResampling'
+        try:
+            sampleOK=not row[overloadFlag]
+            print(f'Using {overloadFlag} -> sampleOK={sampleOK}')
+        except KeyError:
+            sampleOK=True
 
-        if all(remoteFilePresent):
+        if sampleOK and all(remoteFilePresent):
             print("Entry for row done.")
             updateRow(db,project,dataset,row,imageResampledField,\
                 gzFileNames,participantField)