Skip to content

ENH Brain.add_label(): find labels in subfolder #85

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 3 commits into from
Jan 26, 2014

Conversation

christianbrodbeck
Copy link
Collaborator

This would allow

brain.add_label('superiortemporal', subdir='aparc')

@agramfort
Copy link
Contributor

LGTM

@mwaskom
Copy link
Member

mwaskom commented Jan 21, 2014

I like the general idea here, but I'm not wild about the implementation. That looks a lot like a path, but it's not treated as a path. Seems like it could be very confusing.

Other options would be

  • brain.add_label(('aparc', 'superiortemporal'))
  • brain.add_label('superiortemporal', subdir='aparc')

With some preference for latter, but I'm open to other options too.

@christianbrodbeck
Copy link
Collaborator Author

If nobody else wants to weigh in should I just add the subdir argument?

@larsoner
Copy link
Contributor

I also have a preference for the latter subdir method, because I generally
try to avoid passing tuples as an argument when they can be meaningfully
broken out as separate (keyword) arguments.

@agramfort
Copy link
Contributor

fine with me

+1 for merge on my side

@@ -1030,6 +1033,7 @@ def add_label(self, label, color="crimson", alpha=1,
filepath = pjoin(self.subjects_dir,
self.subject_id,
'label',
subdir,
Copy link
Member

Choose a reason for hiding this comment

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

Won't this fail when subdir is None?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry I was too quick!

On Jan 25, 2014, at 12:39 PM, Michael Waskom notifications@github.com wrote:

In surfer/viz.py:

@@ -1030,6 +1033,7 @@ def add_label(self, label, color="crimson", alpha=1,
filepath = pjoin(self.subjects_dir,
self.subject_id,
'label',

  •                             subdir,
    
    Won't this fail when subdir is None?


Reply to this email directly or view it on GitHub.

@christianbrodbeck
Copy link
Collaborator Author

Updated the code and the DOC, better?

@mwaskom
Copy link
Member

mwaskom commented Jan 26, 2014

Thanks!

mwaskom added a commit that referenced this pull request Jan 26, 2014
ENH Brain.add_label():  find labels in SUBJECTS_DIR subfolder
@mwaskom mwaskom merged commit 1655e0f into nipy:master Jan 26, 2014
@christianbrodbeck christianbrodbeck deleted the label-path branch February 3, 2014 22:59
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

Successfully merging this pull request may close these issues.

4 participants