Coder Social home page Coder Social logo

hubmap-penntmc-modeling's People

Contributors

apouch avatar jilei-hao avatar

hubmap-penntmc-modeling's Issues

[Name] Storing section name as field data

Background

The ultimate goal for name displaying is to display section name in the frontend viewer. This requires name data to be generated and mapped to the section labels. We now have each label mesh stored separately. We need to add label name to the each corresponding label mesh.

Requirement

Read the label file into the generator. And create a map between label id and name. Add name as field data to the corresponding label mesh.

Deliverable

  • Read the label description file into generator
  • Create map between label id and label name
  • Add label names to label mesh

[Pelvis Model Rendering] Background appearance for the pelvis model

Background

EPIC: Pelvis Model Rendering

The HuBMAP ovary model generator creates ovary models to be rendered by the web UI, based on user input parameters. To help UI users have a better sense of the location and orientation of the ovary, we want to add a pelvis model to the render scene as a reference.

Task: Transform the pelvis model into correct position

Change the appearance of the pelvis model so it looks like a background structure.

Requirement

Modify the polydata mapper to adjust the appearance of the pelvis model. Give the model a neutral color like white or grey, and adjust the transparency to make it looks like a background.

Deliverables

  • Pelvis model has a background appearance

[Name Displaying] Export the scene in JSON format

Background

EPIC: Name Displaying

An important proposed feature of the HuBMAP Web UI is displaying section names. User should be able to get the section name by pointing to a section (getting name by section), and has the section highlighted when pointing to the name of the section (getting section by name).

Task: Export the scene in JSON format

Now we have a scene with disassembled sections, we need to export the scene to JSON format

Requirements

Use the vtkJSONSceneExporter to export the content in the vtkRenderWindow to a JSON file.

Deliverables

  • The generator exports a JSON scene file

[Bug Fix] Input check for Generator

Requirement

Add a input check for generator. Specifically:
nslices can only be: 1, 3, 12
nrot can only be: 1, 2, 4

Deliverable

  • nslices can accept value 1, 3, 12. Any other value will terminate the program and print a message in std::cerr
  • nrot can accept value 1, 2, 4. Any other value will terminate the program and print a message in std::cerr

Ovary Model Modularization

Background

Currently hubmap-model only has one generator. We need to change it to generate multiple types of models, such as 3d mold, uterus, etc. in addition to the ovary model.

Requirement

For this task, we are focusing on modularizing the ovary generating logic. Create a "OvaryModelGenerator" class to make following code snippet work in the main function.

#include "OvaryModelGenerator.h"

int main () {
    
    OvaryModelGenerator *ovaryGen = new OvaryModelGenerator();
    ovaryGen->SetRotationalSlices(nrot);
    ovaryGen->SetLongAxisSlices(nslice);
    ovaryGen->SetDimensions(d, h, w);
    ovaryGen->IncludePelvis(true);
    ovaryGen->Generate();
    vector<vtkSmartPointer<vtkPolyData>> meshes = ovaryGen->GetOutput();
    
    /*
        Exporting logic
    */
    delete ovaryGen;
    
    return 0;
}

Deliverables

  • Class created
  • Code snippet running without error
  • Getting same result as before

Information

[Pelvis] Modularize the Pelvis model reading logic

Background

The future versions of this generator should be able to generate models more than just ovary models. Instead of putting everything into the main function separated by conditionals, we want a modularized logic to achieve maximum flexibility. Specialized logic should be wrapped in separate classes with a VTK-like interface for user to configure and use.

We can assume the Ovary position does not change after generated by original code.

Requirement

Make following example code snippet work

#include "PelvisModelGenerator.h"

int main () {
    ...
    // context code
    vtkSmartPointer<vtkPolyData>ovary = OvaryModelGenerator->GetOutput();
    const float pelvisIntercristalDistancemm = 290;
    
    // target user code
    PelvisModelGenerator *pvsGen = new PelvisModelGenerator();
    pvsGen->SetIntercristalDistancemm(290);
    pvsGen->SetPositionForPatientLeftOvary(ovary);
    pvsGen->SetPositionForPatientRightOvary(ovary); // optional
    pvsGen->Generate();
    vtkSmartPointer<vtkPolyData>pelvis = pvsGen->GetOutput();
    
    /*
        Exporting logic
    */
    delete pvsGen;
    
    return 0;
}

Deliverables

  • PelvisModelGenerator class created
  • Code snippet run without issue
  • Code snippet generates identical result as current code

[Name Displaying] Disassemble ovary model sections and save to a vtkRenderWindow

Background

EPIC: Name Displaying

An important proposed feature of the HuBMAP Web UI is displaying section names. User should be able to get the section name by pointing to a section (getting name by section), and has the section highlighted when pointing to the name of the section (getting section by name).

Task: Disassemble ovary model sections and save to a vtkRenderWindow

To implement the name displaying feature, the generator has to be modified to generate models in a disassembled format. Currently after extracting level-set models, the generator merges them together into one mesh file. For this task, generator needs to be changed to keep the models in disassembled format, and be added into a vtkRenderWindow, which can then be used to be exported as a JSON scene. The JSON scene then can be used by the web component for the name displaying.

Requirements

Remove the assembling logic that assembles the ovary model sections and add the sections to a vtkRenderWindow.

Deliverables

  • Assembling logic removed
  • Model sections added to vtkRenderWindow
  • Run a test to check if the sections has been rendered correctly

[Pelvis Model Rendering] Transform the pelvis model into correct position

Background

EPIC: Pelvis Model Rendering

The HuBMAP ovary model generator creates ovary models to be rendered by the web UI, based on user input parameters. To help UI users have a better sense of the location and orientation of the ovary, we want to add a pelvis model to the render scene as a reference.

Task: Transform the pelvis model into correct position

The imported pelvis model needs to be transformed to the correct location relative to the ovary model.

Requirement

Use the vtk transformation filter to translate/rotate the pelvis model to move it to the the correct location related to the ovary model.
The term "correct" for this task is based on the standard of human eyes. We don't need extremely precise location since this is just a visual reference. Compare the result to the example page given in the resource section. We can accept the result when the relative locations of ovary and pelvis look similar to what's in the example.

Resources

Example Ovary-Pelvis location: https://training.seer.cancer.gov/ovarian/intro/

Deliverables

  • Pelvis model transformed to the visually correct location

[Pelvis Model Rendering] Load model file into the generator

Background

EPIC: Pelvis Model Rendering

The HuBMAP ovary model generator creates ovary models to be rendered by the web UI, based on user input parameters. To help UI users have a better sense of the location and orientation of the ovary, we want to add a pelvis model to the render scene as a reference.

Task: Load model file into the generator

Import the model into the ovary model generator. The imported format should be able to be added to the render scene of the generator, together with the ovary model.

Requirements

Download the pelvis data from here, and write code to read the model and add output polydata to the scene.

Deliverables

  • Pelvis model downloaded
  • Read the model into the generator and add it to the scene
  • Run a test see if the model has been loaded correctly

[Pelvis] Integrate the pelvis data file into the project

Background

Currently the generator is reading the pelvis file into the scene by using a hard-coded path. To make this program portable, we need to integrate the pelvis model file into the project.

Requirement

Create a data folder in the project source directory. Copy the pelvis data to the data folder and commit the change to the source control. In the CmakeLists.txt, write code to copy the data file to the binary folder, so the program can use relative path to retrieve the data file.

Resource

CMake Copy file: https://stackoverflow.com/questions/34799916/copy-file-from-source-directory-to-binary-directory-using-cmake

Deliverable

  • Data added to source control
  • CMakeList.txt change to copy data to binary folder
  • Use relative path in the code to retrieve the file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.