Exemplo n.º 1
0
 def preprocessing_valid(self):
      self.z_valid = z_calc(self.valid_pat, self.valid_sub_pat)
      self.z_startvalid, self.z_endvalid = calculating_slicesofinterest_segtrain(self.valid_pat, self.valid_sub_pat, self.z_valid, self.roi_interest)
      self.z_startvalid, self.z_endvalid = calculating_slicesofinterestfor3D(self.valid_pat,self.z_startvalid, self.z_endvalid)
      self.x_centvalid, self.y_centvalid = calculate_centroid_segvalid(self.valid_pat,
          self.valid_sub_pat, self.z_startvalid, self.z_endvalid, self.roi_interest)
      np.save(os.path.join(self.main_pred_dir, 'valid.npy'), self.valid_pat)
      np.save(os.path.join(self.main_pred_dir, 'valid_sub.npy'), self.valid_sub_pat)
      np.save(os.path.join(self.main_pred_dir, 'z_valid.npy'), self.z_valid)
      np.save(os.path.join(self.main_pred_dir, 'z_startvalid.npy'), self.z_startvalid)
      np.save(os.path.join(self.main_pred_dir, 'z_endvalid.npy'), self.z_endvalid)
      np.save(os.path.join(self.main_pred_dir, 'x_centvalid.npy'), self.x_centvalid)
      np.save(os.path.join(self.main_pred_dir, 'y_centvalid.npy'), self.y_centvalid)
Exemplo n.º 2
0
 def preprocessing_train(self):
      self.z_TRAIN = z_calc(self.train_pat, self.train_pat_sublist)
      self.z_starttrain, self.z_endtrain = calculating_slicesofinterest_segtrain(self.train_pat, self.train_pat_sublist, self.z_TRAIN, self.roi_interest)
      self.z_starttrain, self.z_endtrain = calculating_slicesofinterestfor3D(self.train_pat,self.z_starttrain, self.z_endtrain)
      self.x_centtrain, self.y_centtrain = calculate_centroid_segtrain(self.train_pat,
          self.train_pat_sublist, self.z_starttrain, self.z_endtrain, self.roi_interest)
      np.save(os.path.join(self.main_pred_dir, 'train.npy'), self.train_pat)
      np.save(os.path.join(self.main_pred_dir, 'train_sub.npy'), self.train_pat_sublist)
      np.save(os.path.join(self.main_pred_dir, 'z_train.npy'), self.z_TRAIN)
      np.save(os.path.join(self.main_pred_dir, 'z_starttrain.npy'), self.z_startvalid)
      np.save(os.path.join(self.main_pred_dir, 'z_endtrain.npy'), self.z_endtrain)
      np.save(os.path.join(self.main_pred_dir, 'x_centtrain.npy'), self.x_centtrain)
      np.save(os.path.join(self.main_pred_dir, 'y_centtrain.npy'), self.y_centtrain)
Exemplo n.º 3
0
 def preprocessing_test(self, oar_pred_dir, oar):
     self.z_starttest, self.z_endtest = calculating_slicesofinterest_segvalid(
         self.test_pat, self.test_sub, self.z_test, oar)
     self.z_starttest, self.z_endtest = calculating_slicesofinterestfor3D(
         self.test_pat, self.z_starttest, self.z_endtest)
     self.x_centtest, self.y_centtest = calculate_centroid_segvalid(
         self.test_pat, self.test_sub, self.z_starttest, self.z_endtest,
         oar)
     np.save(os.path.join(oar_pred_dir, 'test.npy'), self.test_pat)
     np.save(os.path.join(oar_pred_dir, 'test_sub.npy'), self.test_sub)
     np.save(os.path.join(oar_pred_dir, 'z_test.npy'), self.z_test)
     np.save(os.path.join(oar_pred_dir, 'z_starttest.npy'),
             self.z_starttest)
     np.save(os.path.join(oar_pred_dir, 'z_endtest.npy'), self.z_endtest)
     np.save(os.path.join(oar_pred_dir, 'x_centtest.npy'), self.x_centtest)
     np.save(os.path.join(oar_pred_dir, 'y_centtest.npy'), self.y_centtest)