Skip to content

Commit

Permalink
debugs
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD committed Jul 18, 2024
1 parent 1d68a4a commit 5400462
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 6 additions & 8 deletions src/pynwb/ndx_microscopy/testing/_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,9 @@ def mock_MicroscopyPlaneSegmentation(
name = name or name_generator("MicroscopyPlaneSegmentation")

plane_segmentation = ndx_microscopy.MicroscopyPlaneSegmentation(
name=name,
description=description,
imaging_space=imaging_space,
name=name, description=description, imaging_space=imaging_space, id=list(range(number_of_rois))
)
plane_segmentation.add_column(name="id", description="", data=list(range(number_of_rois)))
# plane_segmentation.add_column(name="id", description="", data=list(range(number_of_rois)))

image_masks = list()
for _ in range(number_of_rois):
Expand Down Expand Up @@ -367,9 +365,9 @@ def mock_MultiChannelMicroscopyVolume(
def mock_VariableDepthMultiChannelMicroscopyVolume(
*,
microscope: ndx_microscopy.Microscope,
light_sources: List[ndx_microscopy.MicroscopyLightSource],
imaging_space: ndx_microscopy.VolumetricImagingSpace,
optical_channels: List[ndx_microscopy.MicroscopyOpticalChannel],
light_sources: pynwb.base.VectorData,
optical_channels: pynwb.base.VectorData,
name: Optional[str] = None,
description: str = "This is a mock instance of a MultiChannelMicroscopyVolume type to be used for rapid testing.",
data: Optional[np.ndarray] = None,
Expand All @@ -392,9 +390,9 @@ def mock_VariableDepthMultiChannelMicroscopyVolume(
name=series_name,
description=description,
microscope=microscope,
light_sources=light_sources[0], # TODO: figure out how to specify list
imaging_space=imaging_space,
optical_channels=optical_channels[0], # TODO: figure out how to specify list
light_sources=light_sources,
optical_channels=optical_channels,
data=imaging_data,
depth_per_frame_in_mm=volume_depth_per_frame_in_mm,
unit=unit,
Expand Down
10 changes: 6 additions & 4 deletions src/pynwb/tests/test_roundtrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ def tearDown(self):
def test_roundtrip(self):
nwbfile = mock_NWBFile()

microscope = mock_Microscope()
microscope = mock_Microscope(name="Microscope")
nwbfile.add_device(devices=microscope)

imaging_space = mock_PlanarImagingSpace(microscope=microscope)
imaging_space = mock_PlanarImagingSpace(name="PlanarImagingSpace", microscope=microscope)
nwbfile.add_lab_meta_data(lab_meta_data=imaging_space) # Would prefer .add_imaging_space()

plane_segmentation_1 = mock_MicroscopyPlaneSegmentation(
Expand All @@ -261,8 +261,10 @@ def test_roundtrip(self):
)
microscopy_plane_segmentations = [plane_segmentation_1, plane_segmentation_2]

segmentations = mock_MicroscopySegmentations(microscopy_plane_segmentations=microscopy_plane_segmentations)
processing_module = nwbfile.create_processing_module(name="ophys")
segmentations = mock_MicroscopySegmentations(
name="MicroscopySegmentations", microscopy_plane_segmentations=microscopy_plane_segmentations
)
processing_module = nwbfile.create_processing_module(name="ophys", description="")
processing_module.add(segmentations)

with pynwb.NWBHDF5IO(path=self.nwbfile_path, mode="w") as io:
Expand Down

0 comments on commit 5400462

Please sign in to comment.