Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

understanding the input format #24

Closed
romainVala opened this issue Jan 7, 2020 · 4 comments
Closed

understanding the input format #24

romainVala opened this issue Jan 7, 2020 · 4 comments

Comments

@romainVala
Copy link
Contributor

Hi there

Just a small issue in order to fully understand the input format logic
I see in torchio.py that you define 3 data type : Intensity, label and sampling_map
what is the implication of choosing one of those ?

Why in your example_multimodal.py do you define one_subject_dict with a 'label' which has type=torchio.INTENSITY ? (why not torchio.LABEL ?)

many thanks

@fepegar
Copy link
Owner

fepegar commented Jan 7, 2020

It's true that the function of the type value in the image dict is not clear from the examples. And yes, the type in the example should be LABEL.

For now, I mostly use the type to decide whether to apply or not a transform or to choose an interpolation mode. For example, RandomAffine is applied to all images, but if the type is LABEL, the interpolation is set to nearest neighbor. For some transforms like RandomMotion, the operation is only applied to INTENSITY images.

This value still needs some thinking. I also think that maybe I should define Subject and Image classes that can be used to populate the paths_list. Then the necessary keys can be checked more easily. What do you think?

@fepegar
Copy link
Owner

fepegar commented Jan 7, 2020

Example fixed in cca1830.

@fepegar fepegar added the question Further information is requested label Jan 7, 2020
@romainVala
Copy link
Contributor Author

Ok I see the point, and it makes more sense than the previous solution which was relying on the keywork name

About a Subject class, I am not sure if it is necessary. The ImgeDataset is taking as input a subject_list (which is self explicit)

So now it is the users duty to construct correctly this subject_list. Since it is so much dependent on how you organize your files, I will let it like that

By the way currently the RandomMotion is also applied to label and sampling map, (with different motions)

@fepegar
Copy link
Owner

fepegar commented Jan 7, 2020

Thanks for reporting that.

Maybe a Subject class is not necessary, but an Image one might be useful to validate that the path and type are correct. This format would be dropped when reading the file in ImagesDataset, so that only dicts are passed between transforms.

@fepegar fepegar mentioned this issue Jan 10, 2020
@fepegar fepegar removed the question Further information is requested label Apr 18, 2020
@fepegar fepegar closed this as completed Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants