Commit a429591f authored by Pierre Paleo's avatar Pierre Paleo
Browse files

dataset_analyzer: use magnified pixel size when possible

parent 7f4e416f
Pipeline #35407 passed with stages
in 10 minutes and 38 seconds
......@@ -93,7 +93,7 @@ class DatasetAnalyzer(object):
"""
Return the pixel size in microns.
"""
return self.dataset_scanner.pixel_size * 1e6 # TODO X and Y pixel size
raise ValueError("Must be implemented by inheriting class")
@property
def binning(self):
......@@ -152,6 +152,15 @@ class EDFDatasetAnalyzer(DatasetAnalyzer):
# Not available in EDF dataset
return None
@property
def pixel_size(self):
"""
Return the pixel size in microns.
"""
# TODO X and Y pixel size
return self.dataset_scanner.pixel_size * 1e6
class HDF5DatasetAnalyzer(DatasetAnalyzer):
"""
......@@ -255,6 +264,22 @@ class HDF5DatasetAnalyzer(DatasetAnalyzer):
return self._get_dataset_hdf5_url()
@property
def pixel_size(self):
"""
Return the pixel size in microns.
"""
# TODO X and Y pixel size
try:
xs, yz = self.dataset_scanner._get_x_y_magnified_pixel_values()
ps = xs * 1e6
except AttributeError:
ps = self.dataset_scanner.pixel_size * 1e6
return ps
def analyze_dataset(dataset_path, processes_file=None, extra_options=None):
if not(os.path.isdir(dataset_path)):
if not(os.path.isfile(dataset_path)):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment