You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Weighted ROIs, as returned by sima.segment.STICA, cannot be used for signal extraction. Using r178576528. Minimal standalone sample to reproduce the issue:
importsimaimportsima.segmentimportsima.miscfromshutilimportcopy, copytreecopytree(sima.misc.example_data(), 'example.sima')
copy(sima.misc.example_tiff(), 'example.tif')
dataset=sima.ImagingDataset.load('example.sima')
# The following works, indicating that the ROIs are not "empty":stica_sparse_approach=sima.segment.STICA(components=19, verbose=True)
stica_sparse_approach.append(sima.segment.SparseROIsFromMasks())
stica_sparse_rois=dataset.segment(stica_sparse_approach, 'stica_sparse_ROIs')
signals=dataset.extract(stica_sparse_rois, signal_channel='green',
label='green_signal_stica_sparse')
# The following failsstica_approach=sima.segment.STICA(components=19, verbose=True)
stica_rois=dataset.segment(stica_approach, 'stica_ROIs')
signals=dataset.extract(stica_rois, signal_channel='green', label='green_signal_stica')
Relevant messages:
UserWarning: Empty ROIs will return all NaN values: 19 empty ROIs found
ValueError: No valid ROIs found.
The text was updated successfully, but these errors were encountered:
The extract method has a remove_overlap argument that defaults to True, causing it to remove all overlapping pixels are common to more than one ROI. In the case of mask ROIs, which have values for all pixels, this removes everything.
The error goes away if you change the value of this argument to be False:
I'm somewhat hesitant to change the default behavior, not removing overlapping pixels can actually have a fairly substantial effect on your signals if you expected them to have been removed.
That being said, I'm not sure you'd ever want to remove overlapping pixels for non-boolean masks. We could just disable that ability entirely and throw a warning if you try it?
That being said, I'm not sure you'd ever want to remove overlapping pixels for non-boolean masks. We could just disable that ability entirely and throw a warning if you try it?
Weighted ROIs, as returned by
sima.segment.STICA
, cannot be used for signal extraction. Using r178576528. Minimal standalone sample to reproduce the issue:Relevant messages:
The text was updated successfully, but these errors were encountered: