Coder Social home page Coder Social logo

preprocessing with Label about unires HOT 7 CLOSED

brudfors avatar brudfors commented on June 13, 2024
preprocessing with Label

from unires.

Comments (7)

brudfors avatar brudfors commented on June 13, 2024

Hi @jakubMitura14

Nice to hear that you find the code useful :)

Yes, you can include labels (ensuring that the affine matrices are modified correctly):

self.label: tuple = None # Manual labels, given as (str, (int, int))),

For example, if you have a label file label.nii.gz and one modality you would specify it as:

from unires.struct import settings as s

s.label = ('label.nii.gz', (0, 0))

This function might give some insights into using unires as an api:

def _preproc(pth, atlas_rigid, common_output, device, dir_out, fov, label_file,

Keep in mind that your prostate images need to have good alignment between subjects as unires internal inter-subject alignment method currently only works for brain scans (it uses an atlas-based approach with a T1w brain mean image). That is, this option:

self.do_atlas_align: bool = False # Align images to an atlas space

needs to be set to False. However, if you have some prostate mean image, it could be used to perform the inter-subject alignment.

from unires.

jakubMitura14 avatar jakubMitura14 commented on June 13, 2024

Fantastic! thanks for your response now I will work on it !

from unires.

jakubMitura14 avatar jakubMitura14 commented on June 13, 2024

I would like to ask something futher - precisely about "common_output" - it seem fantasic to get all of the data on the same grid - hovewer I do not see exactly how it works?
I seen that I can pass into the preproc function two dimensional list of paths to nifti files - but only one setting file
so I should put the labels into tuple like

s.label = ('labelA.nii.gz','labelB.nii.gz' )... ?

Also I have t2 (axial coronal, saggital) and adc images labels are associated with t2w image (it was annotated basically on t2 axials) - how to mark it so during registration and resampling labels will be adjusted as the t2w?

Lastly I had done experiment and all resampled files have been written - but not labels, how to specify where the modified resampled labels should be present?

Thanks for Help, and by the way tool is fantastic - It solves so many preprocessing problems at once that it seems automagical !

from unires.

brudfors avatar brudfors commented on June 13, 2024

If you have three images of the same 'repeat' (three T2 scans of different thick-slice direction: coronal, sagittal, axial) and the label is annotated on the axial scan, you would specify this as:

data = [['t2_c.nii.gz', 't2_s.nii.gz', 't2_a.nii.gz']]
s.label = ('label.nii.gz', (0, 2))

You have to ensure that your label image is an integer tensor with values {0, 1, ..., num_labels}. Meaning that if you have multiple binary masks, you will need to merge these into a categorical one.

from unires.

jakubMitura14 avatar jakubMitura14 commented on June 13, 2024

perfect, Thanks! and if I want to put whole dataset (given I had done earlier interpatient registration ) on the same grid as described in "common_output" how to pass multiple labels? And is it problem that in some cases label will be present and in other not - only part of dataset is annotated

Thank You!

from unires.

brudfors avatar brudfors commented on June 13, 2024

UniRes runs on one subject at a time, not on a population. So you would have to call it multiple times, once for each subject.

from unires.

brudfors avatar brudfors commented on June 13, 2024

If no labels are available, then you would just call UniRes w/o labels for those subjects.

from unires.

Related Issues (11)

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.