Closed weiglszonja closed 2 years ago
This might also be a good place/time to update to the new SI standard of having frames/time always be the first dimension like it is in NWB as well
Yes, I also feel that the first dimension should be frames / time.
Opening a discussion about the some inconsistent behavior in
SegmentationExtractor
s, that I noticed while working on #170:get_num_rois()
expects that the traces first dimension corresponds to ROIs: https://github.com/catalystneuro/roiextractors/blob/1f8a479e90a45595de661ad339fa53fc022294e2/src/roiextractors/segmentationextractor.py#L239-L249 and traces are expected to have a shape of (num_rois, num_frames) While for writing we are transposing back to (num_frames, num_rois) -- this is clear why we would do that, time should be first dimension. https://github.com/catalystneuro/neuroconv/blob/4eac38708de6a376025f944e056049bd7c74ba07/src/neuroconv/tools/roiextractors/roiextractors.py#L299get_roi_locations
expects that the last dimension of theimage_masks
correspond to ROIs: https://github.com/catalystneuro/roiextractors/blob/1f8a479e90a45595de661ad339fa53fc022294e2/src/roiextractors/segmentationextractor.py#L98 While for the image masks writing we are transposing back to (num_rois, 2) https://github.com/catalystneuro/neuroconv/blob/4eac38708de6a376025f944e056049bd7c74ba07/src/neuroconv/tools/roiextractors/roiextractors.py#L332I'm not sure about the other segmentation extractors, but for the EXTRACT segmentation data for instance "spatial_weights" are originally have a shape of (num_rois, image_size) -> transposed to (image_size, num_rois) -> for writing its back to (num_rois, image_size). https://github.com/catalystneuro/roiextractors/blob/11da26350dd840c51544d021ea2347a78404fecf/src/roiextractors/extractors/schnitzerextractor/extractsegmentationextractor.py
Can we do something on the base
SegmentationExtractor
side to reduce this? (@CodyCBakerPhD let me know if there is something missing here)