diff --git a/disk/InteractionDisk_temp.py b/disk/InteractionDisk_temp.py index ee6f1d1040f694831f01adfda1098501dbeca82f..1e6f39ed258f66121195700f1d96e9c908a7efff 100644 --- a/disk/InteractionDisk_temp.py +++ b/disk/InteractionDisk_temp.py @@ -476,19 +476,19 @@ class Reader: def LaunchPrediction(self, currentT, currentFOV): - """It launches the neural neutwork on the current image and creates an hdf file with the prediction for the time T and corresponding FOV. """ - file = h5py.File(self.predictname, 'r+') - im = self.LoadOneImage(currentT, currentFOV) - im = skimage.exposure.equalize_adapthist(im) - im = im*1.0; - pred = nn.prediction(im) - file.create_dataset('/{}/{}'.format(self.fovlabels[currentFOV], - self.tlabels[currentT]), data = pred, compression = 'gzip', - compression_opts = 7) + file = h5py.File(self.predictname, 'r+') + if not self.TestTimeExists(currentT, currentFOV): + im = self.LoadOneImage(currentT, currentFOV) + im = skimage.exposure.equalize_adapthist(im) + im = im*1.0; + pred = nn.prediction(im) + file.create_dataset('/{}/{}'.format(self.fovlabels[currentFOV], + self.tlabels[currentT]), data = pred, + compression = 'gzip', compression_opts = 7) file.close()