2013 Project Week:ColorHierarchies

From NAMIC Wiki
Jump to: navigation, search
Home < 2013 Project Week:ColorHierarchies

Key Investigators

  • Nicole Aucoin, BWH

Project Description

Objective

  • create a color table including color values for both models and model hierarchy groups.
  • update the model maker module to output a scene file that has a tree-like model hierarchy (instead of a flat one), with correct colors on the model and the hierarchy display nodes.

Approach, Plan

Approach

Plan:

  • create a data structure to save the new color table hierarchy (storable)
    • extend the color table?
  • create a new module that will let users build a model hierarchy from a color table
  • in the model maker, instead of having to create a new model heirarchy, select for example HeadAndNeckColorTableHierarchy
    • make sure leave the "sample" hierachy available as a base for multiple runs of the model maker
  • future plans: create color table hierarchies for all anatomic based color tables
  • alternately, craft a sample .mrml file with the desired model hiearchy, using the Model modules GUI, then pass the file to the model maker

Progress

  • Head and Neck Atlas 2012 Color Hierarchy text file
  • plain color file
  • mrml scene
  • Discussed this project during the NA-MIC Eng tcon Dec 27th:
    • could think about a realtionship defining node to be the most general
    • could load a scene that defines a hierarchy, then use it for the model maker
      • extend the scene that's passed into the model maker and returned populated with models
    • each label could have a key value, so parent=labelX (could also change the color name to be a key value pair)
    • in the file, enforce leading spaces to show hierarchy?
      • or use JSON?
{
label:100,name:skull,r:128,g:128,b:128,a:255,parent:201
}
  • or lump colors together in one:
color:{128,123,200,255}
  • extension .json? c++ library? vtk doesn't do it, python might, boost? there's JSON Spirit. or manual parsing (whitespace assumptions)?
    • need a reader and writer
  • create the structure through GUI, or write a text file and make a script that converts it to a MRML structure? for end users who want to use a GUI versus edit a text file
  • expand the mrml file that's passed to the model maker to include the full hierarchy and then fill it in
    • associate the hierarhcy with a color node so it's saved/restored?
  • During Project Week:
    • expanding ModelMaker.xml to accept a .mrml file as a parameter
    • in ModelMaker.cxx import the .mrml file with the extra model hierarchy nodes
      • BUG: the parent node references aren't updated when importing this on top of the mini scene that Slicer passes to the model maker, which has a model hierarchy node with id number 1 while the color hierarchy mrml file has the same id
        • Wrote a test for the vtkMRMLScene::Import but was unable to reproduce the problem outside of ModelMaker
    • search for model hierarchy nodes with names that match the color names of the models and set the associated node id on them
    • in vtkSlicerApplicationLogic::ProcessReadSceneData it only reads in model hierarchies that are children of the passed in model hierarchy, it doesn't recurse, so the models are not read in since they're too many levels down
      • after discussion with Jim Miller, extended the code to deal with the multilevel hierarchy, checked into github
      • also checked in new ModelMaker code using the fix
    • To Do: create template model hierarchies for more color files and incorporate them into the Slicer repository