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

NormalisationTransform has no attribute masking_method #49

Closed
romainVala opened this issue Jan 16, 2020 · 9 comments
Closed

NormalisationTransform has no attribute masking_method #49

romainVala opened this issue Jan 16, 2020 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@romainVala
Copy link
Contributor

I get an error with
transfo = Compose(( Rescale(masking_method='mask', verbose=True),))

In the init of NormalizationTransform you use self.masking_method
but it is not assign

@romainVala
Copy link
Contributor Author

romainVala commented Jan 16, 2020

it is not assign if you use a string as argument

@fepegar fepegar added the bug Something isn't working label Jan 16, 2020
@fepegar fepegar self-assigned this Jan 16, 2020
@fepegar
Copy link
Owner

fepegar commented Jan 16, 2020

Fixed in v0.11.3. Thanks, @romainVala

@fepegar
Copy link
Owner

fepegar commented Jan 16, 2020

By the way,

  1. Are you using Rescale for CT data?
  2. You don't need to use Compose if you only have one transform

@romainVala
Copy link
Contributor Author

Ok pour Compose, (I though it was mandatory)

I do not work with CT data, I use rescale to have number between 0 and 1 (by the way I would change the default for out_min_max 0 1

Currently I do not undersand, why I get value between 1 and 3 instead of value between -1 1 ... (but it woks fine if I ask fo (0,1) ...

@romainVala
Copy link
Contributor Author

Instead of
array -= self.out_min # [out_min, out_max]
it should be
array += self.out_min # [out_min, out_max]

fepegar added a commit that referenced this issue Jan 16, 2020
@fepegar
Copy link
Owner

fepegar commented Jan 16, 2020

Thanks again! I definitely need to write some unit tests...

@fepegar
Copy link
Owner

fepegar commented Jan 16, 2020

Is there a strong reason to choose (0, 1) over (-1, 1)?

@fepegar
Copy link
Owner

fepegar commented Jan 16, 2020

I'd like to make this implementation look more like https://github.com/scikit-image/scikit-image/blob/master/skimage/exposure/exposure.py#L269

@romainVala
Copy link
Contributor Author

I do not know if it makes a difference from a CNN point of view. ... ?

It is just that mri is usually always positive (see #37 (comment))

Other point may be, after masking you usually get voxel value to zero in the background, so normalizing to -1 1 will break it ...

but not a big deal it is just the default value, easy to change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants