From e31df8875da1157c4ccda5144f9ce3d5ce298f24 Mon Sep 17 00:00:00 2001 From: muellerdo Date: Thu, 1 Oct 2020 14:43:17 +0200 Subject: [PATCH] Added array type transformation for subfunction preprocessing in order to reduce required disk space of batches --- miscnn/processing/preprocessor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/miscnn/processing/preprocessor.py b/miscnn/processing/preprocessor.py index 70f2a19..28cb1d4 100644 --- a/miscnn/processing/preprocessor.py +++ b/miscnn/processing/preprocessor.py @@ -239,6 +239,9 @@ def prepare_sample_subfunctions(self, index, training): # Run provided subfunctions on imaging data for sf in self.subfunctions: sf.preprocessing(sample, training=training) + # Transform array data types in order to save disk space + sample.img_data = np.array(sample.img_data, dtype=np.float32) + sample.seg_data = np.array(sample.seg_data, dtype=np.uint8) # Backup sample as pickle to disk self.data_io.backup_sample(sample)