Skip to content

Commit

Permalink
Deprecate ImageMaskSeries
Browse files Browse the repository at this point in the history
  • Loading branch information
rly committed Jul 23, 2024
1 parent fcd7008 commit f0b3f08
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion docs/gallery/general/plot_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
* **Optical physiology and imaging:** :py:class:`~pynwb.image.ImageSeries` is the base type
for image recordings and is further refined by the
:py:class:`~pynwb.image.ImageMaskSeries`,
:py:class:`~pynwb.image.OpticalSeries`,
:py:class:`~pynwb.ophys.OnePhotonSeries`, and
:py:class:`~pynwb.ophys.TwoPhotonSeries` types.
Expand Down
12 changes: 8 additions & 4 deletions src/pynwb/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def __init__(self, **kwargs):
@register_class('ImageMaskSeries', CORE_NAMESPACE)
class ImageMaskSeries(ImageSeries):
'''
An alpha mask that is applied to a presented visual stimulus. The data[] array contains an array
DEPRECATED. An alpha mask that is applied to a presented visual stimulus. The data[] array contains an array
of mask values that are applied to the displayed image. Mask values are stored as RGBA. Mask
can vary with time. The timestamps array indicates the starting time of a mask, and that mask
pattern continues until it's explicitly changed.
Expand All @@ -299,9 +299,13 @@ class ImageMaskSeries(ImageSeries):
'The device used to capture the masked ImageSeries data should be stored in the ImageSeries.'),
'default': None},)
def __init__(self, **kwargs):
masked_imageseries = popargs('masked_imageseries', kwargs)
super().__init__(**kwargs)
self.masked_imageseries = masked_imageseries
raise ValueError(
"This neurodata type is deprecated. If you are interested in using it, "
"please create an issue on https://github.com/NeurodataWithoutBorders/nwb-schema/issues."
)
# masked_imageseries = popargs('masked_imageseries', kwargs)
# super().__init__(**kwargs)
# self.masked_imageseries = masked_imageseries


@register_class('OpticalSeries', CORE_NAMESPACE)
Expand Down
10 changes: 2 additions & 8 deletions tests/unit/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,10 @@ def test_init(self):
external_file=['external_file'], starting_frame=[0], format='external',
timestamps=[1., .2])

ims = ImageMaskSeries(name='test_ims', unit='unit',
with self.assertRaises(ValueError):
ImageMaskSeries(name='test_ims', unit='unit',
masked_imageseries=iS, external_file=['external_file'], starting_frame=[0],
format='external', timestamps=[1., 2.])
self.assertEqual(ims.name, 'test_ims')
self.assertEqual(ims.unit, 'unit')
self.assertIs(ims.masked_imageseries, iS)
self.assertEqual(ims.external_file, ['external_file'])
self.assertEqual(ims.starting_frame, [0])
self.assertEqual(ims.format, 'external')


class OpticalSeriesConstructor(TestCase):

Expand Down

0 comments on commit f0b3f08

Please sign in to comment.