-
Notifications
You must be signed in to change notification settings - Fork 437
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
ENH: Implement masking for the new TensorModel implementation. #96
Conversation
# If a mask is provided, we will use it to access the data | ||
if mask is not None: | ||
# Make sure it's boolean, so that it can be used to mask | ||
mask = np.array(mask, dtype=bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use copy=False here to prevent copying if we don't need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep. good call.
On Wed, Dec 5, 2012 at 11:34 AM, MrBago notifications@github.com wrote:
In dipy/reconst/dti.py:
"""
dti_params = self.fit_method(self.design_matrix, data,
- _self.args, *_self.kwargs)
return TensorFit(self, dti_params)
# If a mask is provided, we will use it to access the data
if mask is not None:
# Make sure it's boolean, so that it can be used to mask
mask = np.array(mask, dtype=bool)
We should use copy=False here to prevent copying if we don't need to.
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/96/files#r2325597.
Cool! |
ENH: Implement masking for the new TensorModel implementation.
@@ -62,12 +62,26 @@ def fit(self, data): | |||
data : array | |||
The measured signal from one voxel. | |||
|
|||
mask : array | |||
A boolean array used to mark the coordinates in the data that | |||
should be analyzed that has the shape data.shape[-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``data.shape[-1]``
An interesting aside, you can now fit the tensormodel in two different ways:
Cool! We should document these two approaches and do some timing comparisons! |
No description provided.