api-python icon indicating copy to clipboard operation
api-python copied to clipboard

Query on using links within ImageSegmentation reference_images

Open jonc125 opened this issue 8 years ago • 2 comments

Rather than creating fresh groups within the reference_images group, I'd like to link to existing groups in /acquisition/timeseries. However, my groups there are TwoPhotonSeries groups, and when I do

ref_imgs.make_group('<image_name>', name='Zstack_image',
                                    link='link:/acquisition/timeseries/Zstack_Red_0033')

I get a warning from the validator:

6 Miscellaneous warnings (1 combined):
  1. /processing/Acquired_ROIs/ImageSegmentation/Zstack#/reference_images/Zstack_image
     - type (core:<image_name>/) is linked to a different type (core:<TwoPhotonSeries>/)
     at: /acquisition/timeseries/Zstack_Red_# (#=33,36-37,47,49,52)

I'm guessing this is because the spec defines reference_images using merge rather than link

            "reference_images/": {
                "description": "Stores image stacks segmentation mask apply to.",
                "<image_name>/+": {
                    "description": ("One or more image stacks that the masks apply "
                        "to (can be one-element stack)"),
                    "merge+": ["<ImageSeries>/",] }}

So my question is, am I doing something wrong here, or should the spec be adapted to allow this use case?

jonc125 avatar Apr 11 '17 14:04 jonc125

You are not doing anything wrong. The validator currently does not do a good job of validating links which are not specified using the "link" keyword in the specification. The information is in the specification to deduce that what you did is OK (since <image_name> is an ImageSeries or subclass, and it is being linked to a TwoPhotonSeries which is a subclass of ImageSeries). So, you can ignore the warning. This is something that needs to be fixed.

jeffteeters avatar Apr 12 '17 00:04 jeffteeters

OK, thanks, I'll stop worrying about that one then!

Feel free to leave the issue open if you want it as a reminder to fix this, or close if you're tracking it separately.

jonc125 avatar Apr 12 '17 08:04 jonc125