mlexchange / mlex_highres_segmentation

A Dash interface for ML-based segmentation of user-annotated large multi-dimensional image data
Other
5 stars 4 forks source link

Save pixelated masks to Tiled #172

Closed Wiebke closed 8 months ago

Wiebke commented 8 months ago

This PR makes the following changes:

An example for mask meta data with two annotated slices containing some rectangles and a freeform is given below.

{
   "classes":{
      "0":{
         "color":"#004280",
         "label":"Background"
      },
      "1":{
         "color":"#ffae00",
         "label":"Clay"
      },
      "2":{
         "color":"#ff1900",
         "label":"Clay Anomaly"
      }
   },
   "data_uri":"https://tiled-seg.als.lbl.gov/api/v1/metadata/reconstruction/rec20190524_085542_clay_testZMQ_8bit/20190524_085542_clay_testZMQ_",
   "mask_idx":[
      "64",
      "222"
   ],
   "annotations":{
      "64":[
         {
            "type":"Rectangle",
            "class_id":"0",
            "svg_data":{
               "..."
            }
         },
         {
            "type":"Ellipse",
            "class_id":"1",
            "svg_data":{
               "..."
            }
         }
      ],
      "222":[
         {
            "type":"Closed Freeform",
            "class_id":"0",
            "svg_data":{
               "path":"..."
            }
         },
         {
            "type":"Rectangle",
            "class_id":"0",
            "svg_data":{
               "..."
            }
         },
         {
            "type":"Rectangle",
            "class_id":"1",
            "svg_data":{
               "..."
            }
         },
         {
            "type":"Rectangle",
            "class_id":"1",
            "svg_data":{
               "..."
            }
         },
         {
            "type":"Closed Freeform",
            "class_id":"2",
            "svg_data":{
               "path":"..."
            }
         }
      ]
   },
   "image_shape":[
      1760,
      1760
   ],
   "project_name":"rec20190524_085542_clay_testZMQ_8bit",
   "unlabeled_class_id":-1
}

with the second exported colored slice as

mask

This partially resolves #160, but annotation export still relies on files.