Browse Source

Adding patientmask to outputs of preprocess.py

Andrej 4 years ago
parent
commit
b0705b354d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      pythonScripts/preprocess.py

+ 4 - 2
pythonScripts/preprocess.py

@@ -60,7 +60,8 @@ participantField='ParticipantId'
 ds=db.selectRows(project,'study',dataset,[])
 #imageSelector={"CT":"CT","PET":"PETWB"};
 imageSelector={"CT":"CT_orthancId","PET":"PETWB_orthancId"}
-imageResampledField={"CT":"ctResampled","PET":"petResampled"}
+#output
+imageResampledField={"CT":"ctResampled","PET":"petResampled","patientmask":"ROImask"}
 
 #projectNIfTIBase=os.path.join(labkeyBase,'files',project,'@files/nifti')
 #use webdav to transfer file (even though it is localhost)
@@ -154,7 +155,7 @@ for row in ds["rows"]:
     volumeFileNames={im:\
             getStudyLabel(row,participantField)+'_'+im+
             '_notCropped_2mmVoxel.nii'\
-                for im in imageSelector}
+                for im in imageResampledField}
     gzFileNames={im:f+".gz" \
             for (im,f) in volumeFileNames.items()}
     
@@ -207,6 +208,7 @@ for row in ds["rows"]:
     
     if not all(filesPresent):
 
+        #use imageSelector -> inputs
         for im in imageSelector:
             #checks if raw files are already loaded
             getDicom(ofb,row,zipDir,rawDir,im,imageSelector,\