Example #1
0
 def addContainer(self, nwbfile):
     nwbfile.add_imaging_plane(self.imaging_plane)
     img_seg = ImageSegmentation('plane segmentation round trip')
     img_seg.add_plane_segmentation(self.container)
     mod = nwbfile.create_processing_module(
         'plane_seg_test_module', 'plane segmentation round trip',
         'a plain module for testing')
     mod.add_data_interface(img_seg)
Example #2
0
 def addContainer(self, nwbfile):
     nwbfile.add_device(self.device)
     nwbfile.add_imaging_plane(self.imaging_plane)
     img_seg = ImageSegmentation()
     img_seg.add_plane_segmentation(self.container)
     mod = nwbfile.create_processing_module('plane_seg_test_module',
                                            'a plain module for testing')
     mod.add(img_seg)
Example #3
0
 def addContainer(self, nwbfile):
     nwbfile.add_device(self.device)
     nwbfile.add_imaging_plane(self.imaging_plane)
     img_seg = ImageSegmentation()
     img_seg.add_plane_segmentation(self.plane_segmentation)
     mod = nwbfile.create_processing_module('plane_seg_test_module',
                                            'a plain module for testing')
     mod.add(img_seg)
     super(TestRoiResponseSeriesIO, self).addContainer(nwbfile)
Example #4
0
 def addContainer(self, nwbfile):
     """
     Add an ImageSegmentation in processing with a PlaneSegmentation and add Device and ImagingPlane to the
     given NWBFile
     """
     nwbfile.add_device(self.device)
     nwbfile.add_imaging_plane(self.imaging_plane)
     img_seg = ImageSegmentation()
     img_seg.add_plane_segmentation(self.container)
     self.mod = nwbfile.create_processing_module(
         'plane_seg_test_module', 'a plain module for testing')
     self.mod.add(img_seg)
Example #5
0
 def addContainer(self, nwbfile):
     """
     Add the test RoiResponseSeries as an acquisition and add Device, ImagingPlane, ImageSegmentation, and
     PlaneSegmentation to the given NWBFile
     """
     nwbfile.add_device(self.device)
     nwbfile.add_imaging_plane(self.imaging_plane)
     img_seg = ImageSegmentation()
     img_seg.add_plane_segmentation(self.plane_segmentation)
     mod = nwbfile.create_processing_module('plane_seg_test_module',
                                            'a plain module for testing')
     mod.add(img_seg)
     super().addContainer(nwbfile)
Example #6
0
img_seg = ImageSegmentation()
mod.add(img_seg)
ps = img_seg.create_plane_segmentation(
    'output from segmenting my favorite imaging plane', imaging_plane,
    'my_planeseg', image_series)
w, h = 3, 3
pix_mask1 = [(0, 0, 1.1), (1, 1, 1.2), (2, 2, 1.3)]
img_mask1 = [[0.0 for x in range(w)] for y in range(h)]
img_mask1[0][0] = 1.1
img_mask1[1][1] = 1.2
img_mask1[2][2] = 1.3
ps.add_roi(pixel_mask=pix_mask1, image_mask=img_mask1)

bob = pynwb.ophys.PlaneSegmentation('description', imaging_plane, name="bob")

#Alas, I can't just tack stuff onto the plane segmentation
#ps.add_container(cortical_surface)

img_seg.add_plane_segmentation(bob)
bob.add_roi(pixel_mask=pix_mask1, image_mask=img_mask1)

duck = BlenderPlaneSegmentation('description',
                                imaging_plane,
                                name="blender seg",
                                blender_surface=soma_surface)
duck.add_roi(pixel_mask=pix_mask1, image_mask=img_mask1)
img_seg.add_plane_segmentation(duck)

with NWBHDF5IO('bubtest2.nwb', 'w') as io:
    io.write(nwbfile)