-
Notifications
You must be signed in to change notification settings - Fork 11
Description
[Draft]
I discussed this today with @weiglszonja and we converged to this solution. I am writing the context here for provenance and as a to-do list.
The main problem is a clash between the plane specification and the channel specification that are both passed as stream_name to BrukerTiffSinglePlaneImagingExtractor. **For the test examples we have got this works because the channel names are always part of the file name ** (and therefore of the string implementation) see here:
roiextractors/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py
Lines 167 to 175 in 29c3491
| folder_path: PathType, | |
| stream_name: Optional[str] = None, | |
| ): | |
| """Create a BrukerTiffMultiPlaneImagingExtractor instance from a folder path that contains the image files. | |
| Parameters | |
| ---------- | |
| folder_path : PathType | |
| The path to the folder that contains the Bruker TIF image files (.ome.tif) and configuration files (.xml, .env). |
And this is applied to xml elements that look like this:
<File channel="2" channelName="Ch2" filename="NCCR32_2022_11_03_IntoTheVoid_t_series-005_Cycle00001_Ch2_000001.ome.tif" />See that the channelName is part of the file_paths. However, this assumption does not hold for data from the Clandinin lab and the data from this other issue #341 here so we need to decouple.
A first attempt was done here:
#343
This works for the BrukerTiffSinglePlaneImagingExtractor because we can look for the file_paths that correspond to a channel name and have very specific list of file and that works. Unfortunately, this breaks the use case of BrukerTiffMultiPlaneImagingExtractor passing plane streams to BrukerTiffSinglePlaneImagingExtractor here:
roiextractors/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py
Lines 239 to 242 in 29c3491
| # TODO: fix this method so that it is consistent with base multiimagingextractor method (i.e. num_rows, num_columns) | |
| def get_image_size(self) -> Tuple[int, int, int]: | |
| return self._image_size |
Because that also relied on the assumption that the plane specification we have is contained in the file name.
So what gives?
The thing that we can do programatically is find all the file_paths that correspond to a channel.
The thing that we can do programatically is find a simple and friendly user specifation to get a single plane. Yet.