Переглянути джерело

Rounding nvoxels to nearest integer, adding ERROR to lines reporting difficulties with upload, and reporting segmentation dataset when in getSegmentations for statUtils.py

nixWorker 11 місяців тому
батько
коміт
15bde3a8c0
1 змінених файлів з 3 додано та 2 видалено
  1. 3 2
      pythonScripts/statUtils.py

+ 3 - 2
pythonScripts/statUtils.py

@@ -66,6 +66,7 @@ def getImage(setup, row, field, extraPath=None):
 
 def getSegmentations(setup,row):
     segName=setup.get('segmentationDataset','Segmentations')
+    print(f'Using segmentation dataset {segName}')
     idField=setup['idField']
     visitField=setup['visitField']
     qFilter=[{'variable':x,'value':row[x],'oper':'eq'} for x in [idField,visitField]]
@@ -156,7 +157,7 @@ def getCOM(vals):
     return vals['diagnostics_Mask-original_CenterOfMassIndex']
 
 def getNVoxels(vals):
-    return drop_array(vals['original_shape_VoxelVolume']/8)
+    return round(drop_array(vals['original_shape_VoxelVolume']/8))
 
 def getValue(vals,valueName):
     if valueName=='SUVmean':
@@ -239,7 +240,7 @@ def updateDatasetRows(db,project,dataset,rows,filterVars=['ParticipantId','Seque
         #encoding=chardet.detect(resp)['encoding']
         #respJSON=json.loads(resp.decode(encoding))
         try:
-            print(resp['exception'])
+            print('[ERROR]: {}'.format(resp['exception']))
             print(f'Using mode={mode}')
         except KeyError:
             pass