Skip to content

Commit

Permalink
Reverting back conversion of buggy masks
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwarchol committed Sep 23, 2021
1 parent bab0abd commit 012534a
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions minerva_analysis/server/models/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,25 +664,17 @@ def convertOmeTiff(filePath, channelFilePath=None, dataDirectory=None, isLabelIm
channel_io = tf.TiffFile(str(channelFilePath), is_ome=False)
channels = zarr.open(channel_io.series[0].aszarr())
write_path = None
# removing '.ome' from the name
directory = Path(dataDirectory + "/" + str(filePath.name).replace('.ome', '_pyramided'))
args = {}
args['in_paths'] = [Path(filePath)]
args['out_path'] = directory
args['is_mask'] = True
pyramid_assemble.main(py_args=args)
write_path = str(directory)
# TODO: Reintroduce when MCMICRO pipeline produces better masks
# segmentation_mask = tf.TiffFile(str(filePath), is_ome=False)
# if segmentation_mask.series[0].aszarr().is_multiscales is False:
# args = {}
# args['in_paths'] = [Path(filePath)]
# args['out_path'] = directory
# args['is_mask'] = True
# pyramid_assemble.main(py_args=args)
# write_path = str(directory)
# else:
# write_path = str(filePath)
directory = Path(dataDirectory + "/" + filePath.name)
segmentation_mask = tf.TiffFile(str(filePath), is_ome=False)
if segmentation_mask.series[0].aszarr().is_multiscales is False:
args = {}
args['in_paths'] = [Path(filePath)]
args['out_path'] = directory
args['is_mask'] = True
pyramid_assemble.main(py_args=args)
write_path = str(directory)
else:
write_path = str(filePath)
return {'segmentation': write_path}


Expand Down

0 comments on commit 012534a

Please sign in to comment.