Skip to content
Browse files

Added training set file validation

  • Loading branch information...
1 parent 954076e commit bc75c3c533f0064d95f40b2ea85c98906efc7d90 @braymp braymp committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 cellprofiler/modules/straightenworms.py
View
8 cellprofiler/modules/straightenworms.py
@@ -45,6 +45,7 @@
__version__="$Revision: 10717 %"
import numpy as np
+import os
from scipy.interpolate import interp1d
from scipy.interpolate.fitpack import bisplrep, dblint
from scipy.ndimage import map_coordinates, extrema
@@ -275,6 +276,13 @@ def visible_settings(self):
result += [ self.add_image_button ]
return result
+ def validate_module(self, pipeline):
+ path = os.path.join(self.training_set_directory.get_absolute_path(),
+ self.training_set_file_name.value)
+ if not os.path.exists(path):
+ raise cps.ValidationError("Can't find file %s" % self.training_set_file_name.value,
+ self.training_set_file_name)
+
def prepare_settings(self, setting_values):
nimages = int(setting_values[IDX_IMAGE_COUNT])
del self.images[1:]

0 comments on commit bc75c3c

Please sign in to comment.
Something went wrong with that request. Please try again.