From 48e1466ba2ffad7b108064f7de3e6debb6a2b21a Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Thu, 19 Sep 2024 22:13:21 -0700 Subject: [PATCH] Update image.py --- src/pynwb/image.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pynwb/image.py b/src/pynwb/image.py index 0d7c75cd0..c775297d7 100644 --- a/src/pynwb/image.py +++ b/src/pynwb/image.py @@ -280,7 +280,8 @@ def __init__(self, **kwargs): @register_class('ImageMaskSeries', CORE_NAMESPACE) class ImageMaskSeries(ImageSeries): ''' - DEPRECATED. An alpha mask that is applied to a presented visual stimulus. The data[] array contains an array + DEPRECATED as of NWB 2.8.0 and PyNWB 3.0.0. + 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. @@ -299,13 +300,14 @@ class ImageMaskSeries(ImageSeries): 'The device used to capture the masked ImageSeries data should be stored in the ImageSeries.'), 'default': None},) def __init__(self, **kwargs): - 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 + if not self._in_construct_mode: + raise ValueError( + "The ImageMaskSeries 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)