-
Notifications
You must be signed in to change notification settings - Fork 1
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
added user given output directory #1
Conversation
This modified pipeline was successfully run on a sample dataset. Let's try to push this to the |
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.
Looks great @tdincer! just one minor change with some whitespace at the end of a line. 👍
Co-authored-by: jverswijver <49455164+jverswijver@users.noreply.github.com>
@@ -337,7 +342,7 @@ def fit_file(self, motion_correct=False, indices=None, include_eval=False): | |||
logging.warning("Error: File not found, with file list:\n" + fnames[0]) | |||
raise Exception('File not found!') | |||
|
|||
base_name = pathlib.Path(fnames[0]).stem + "_memmap_" | |||
base_name = (pathlib.Path(output_dir) / (pathlib.Path(fnames[0]).stem + "_memmap_")).as_posix() |
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.
I'd double check here on how base_name
is used. I think base_name
should not contain any path, but only a filename (or prefix to a filename), so we should not join output_dir
here.
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.
@ttngu207 base_name
is passed only to mmapping.save_memmap
together with the full path file names in line 369 or 372, depending on a condition. Addition of another path related keyword looks excessive to me. There is only one caveat. The docstring in mmapping.save_memmap
clearly states that the base_name
must not contain underscore character. As long as this caveat is considered we should be good.
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 cannot guarantee base_name
will not contain underscore especially when base_name
is now a full path.
On second look, I do think you don't need to include the output_dir
as part of the base_name
here. And you don't need to pass output_dir
into mmapping.save_memmap
.
In the mmapping.save_memmap
, the path is actually retrieved from fname
, which, in this case, is passed in as fname_mc
(line 369 below).
fname_mc
is generated from the output of mc.motion_correct
, which should already account for the correct output_dir
.
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.
overall looks good, I have a few comments/suggestions
Co-authored-by: Thinh Nguyen <thinhnguyen0405@gmail.com>
changed `if return_mc:` to ` if return_mc & motion_correct:` to make sure that motion correction is applied if we want to return the `motion correction object`
`base_name` line is changed to its original form.
@ttngu207 This one is finally ready to merge (see adjusted .npz file output directory). |
Added:
cnmf.fit_file
methodcnmf.fit_file
to return movie correction object