Coder Social home page Coder Social logo

Comments (4)

NathanMolinier avatar NathanMolinier commented on June 26, 2024 2

code like this one is supposed to take care of this, no?

Yes it is indeed the case, however I don't know if nnUNet is performing any reorientations beforehand.

Also, I wanted to remind that conventions may be different depending on the tools that were used: for example, reorientation could be done before the training as pre-processing using SCT for example or using MONAI's transform.

from spinalcordtoolbox.

joshuacwnewton avatar joshuacwnewton commented on June 26, 2024 1

Couldn't we encode the reorientation step directly from MONAI's data preparation phase, while running the inference? Eg: code like this one is supposed to take care of this, no?

Yes, SCT contains this exact same line in our current contrast agnostic code.

MONAI (inference transforms):

Orientationd(keys=["image"], axcodes="RPI"),

nnUNetv2 (manually, since we predict directly on a numpy array):

# Get the orientation used by the model
if "SCI" in predictor.plans_manager.dataset_name:
model_orientation = "RPI"
else:
model_orientation = "LPI"

Because we are hardcoding the axcodes inside the inference functions, I wanted to just do a simple reorganization to move these hardcoded values alongside the models themselves.

(This came up because the canproco nnunetv2 model uses the AIL orientation, which required a change to the hardcoded values.)

from spinalcordtoolbox.

jcohenadad avatar jcohenadad commented on June 26, 2024

Perhaps it would be best to add "orientation" to the MODELS dict for each of the nnunet/monai models, then specify LPI/RPI/AIL on a per-model basis, then fetch this value from the model dict when reorienting the input image?

Couldn't we encode the reorientation step directly from MONAI's data preparation phase, while running the inference? Eg: code like this one is supposed to take care of this, no? Tagging @naga-karthik @plbenveniste @Nilser3 @NathanMolinier

from spinalcordtoolbox.

NathanMolinier avatar NathanMolinier commented on June 26, 2024

I did not implement any model yet to SCT, but aren't we calling model specific inference scripts when calling the models ?

from spinalcordtoolbox.

Related Issues (20)

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.