Skip to content

[ENH] Improvements on fsl.Smooth #1341

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

Merged
merged 5 commits into from
Feb 3, 2016
Merged

Conversation

oesteban
Copy link
Contributor

@oesteban oesteban commented Feb 1, 2016

  • Added new input sigma which passes value as given, and made it compatible with the input fwhm.
  • Added 3 doctests
  • Improved documentation.

Fixes #1324

def _format_arg(self, name, trait_spec, value):
if name == 'fwhm':
sigma = float(value) / np.sqrt(8 * np.log(2))
return super(Smooth, self)._format_arg(name, trait_spec, sigma)
return super(Smooth, self)._format_arg(name, trait_spec, value)

def _parse_inputs(self, skip=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can have mandatory=True for the fields, which should take care of the need to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I wasn't sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it does, but only refers to the first of the xor parameters specified on the error message. For now it's ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmm it's a bit worse than that. Sometimes it asks for the new sigma, sometimes for the old fwhm. We should print all the xor parameters in the message (or simplify it).

@mwaskom
Copy link
Member

mwaskom commented Feb 1, 2016

I still think there is the broader issue that we now print the argument string in the help but provide no information about possible internal reformatting of arguments.

This also probably isn't the only place in our fsl interfaces where we accept a fwhm parameter and convert it to sigma internally. Even without solving the broader problem, it might be good to extend this change to those interfaces for the sake of consistency? fsl.SUSAN comes to mind.

@oesteban
Copy link
Contributor Author

oesteban commented Feb 1, 2016

Yep, my idea was to give a short-term answer to the problem raised by @poldrack . I have also updated the documentation and mentioned the conversion of the argument, and showed it with an example commandline.

I agree this should be definitely extended to other interfaces and, if possible, take on the broader issue you point out. But I would do this in a separate issue/PR so that this one goes through.

@oesteban
Copy link
Contributor Author

oesteban commented Feb 3, 2016

@mwaskom @satra @chrisfilo do you think this is fine to go ahead?. Then the ideas proposed by @mwaskom would be included through a different PR, what do you think?. Even a general polishing of all fsl interfaces (the issue here and any others) would be great news.

satra added a commit that referenced this pull request Feb 3, 2016
[ENH] Improvements on fsl.Smooth
@satra satra merged commit 267e42a into nipy:master Feb 3, 2016
@oesteban oesteban deleted the enh/DocFSLUtils branch February 3, 2016 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants