Closed h-mayorquin closed 2 months ago
Ah, OK, this is a case for a problem when using a single argument to specify plane and channel.
We pass plane_stream (a string identifying the plane) as a stream to BrukerTiffSinglePlaneImagingExtractor
. But in some other places we pass a channel. The current implementation is relying on the fact that both are included in the filename and that this code will work. However, as I argued above the channelName is not always in the filename.
I think at least at this level we should seprate them, it would make the implementation easier.
Thank you @h-mayorquin for looking into this issue. I still think that (following this issue):
We refactor the code so the classes are clearly separated as you guys propose.
would be the way to go, it would follow how @pauladkisson refactored the extractor for ScanImage, I believe we don't have a routing class there either. We didn't know it was a bug because the examples that we've seen for Bruker always followed the convention we built on, I think it would be reasonable to have designated classes instead of a router.
Ok, @weiglszonja I found a way of solving this without requiring more changes. I think that the changes we have discussed are more robust and would make the code clear but this should be a intermediate fix. Note that this requires https://github.com/catalystneuro/roiextractors/pull/344 before merging.
The current code assumes that the channel name (the stream) should be in the filename. This is not the case for some data that I have. Here is a frame element in the correspoding xml
As you can see the current asumption is not valid and therefore the code is a bug. The fix proposed in this PR yses the channelName in the xml element to filter the file paths that correspond to the channel.