-
Notifications
You must be signed in to change notification settings - Fork 0
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
adding functions for 2p alignment #7
Conversation
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.
Good! A test would be nice though :)
fimpy/pipeline/alignment.py
Outdated
@@ -8,6 +8,8 @@ | |||
shift_stack, | |||
sobel_stack, | |||
) | |||
from skimage.feature import register_translation |
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 thought we switched to https://scikit-image.org/docs/stable/api/skimage.registration.html?highlight=phase_cross_correlation#phase-cross-correlation with the new scikit-image
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.
True, I missed this. I switched the functions.
shape_block=(dataset.shape_block[0], 1) + dataset.shape_block[2:], | ||
) | ||
|
||
if verbose: |
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 replace all of those verbose
with the logging module (can be done in a later PR)
""" | ||
|
||
# prepare the destination | ||
new_dataset = EmptySplitDataset( |
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.
if resolution is in the original dataset, it would be good to pass it 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.
Should I add an optional input variable for the resolution (with None as default)?
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.
no, it doesn't make sense to insert it here, it should only be passed if the original dataset has it
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.
Ok, so this request is not clear to me. What does if the original dataset has it means? I thought because fimpy is public it should be general.
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.
So at some point it was decided that the SplitDataset class optionally contains resolution and dimension order attributes
e.g.
https://github.com/portugueslab/split_dataset/blob/1faa37954a1fe7bcd23021e2f93238f7b94affb5/split_dataset/split_dataset.py#L113
it makes sense that all operations that work on SplitDataset preserve this information. (so if you e.g. align a dataset which has these fields, the aligned dataset will have these attributes as well). A more elegant, consistent solution for all of this would use xarray, but @vigji is still ambivalent over file formats supported by xarray.
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 am ambivalent indeed :D so so far we are just storing the resolution, and if one day we move to xarray supporting formats we have the information to move there the stack easily
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.
it's not just resolution, dimension order is important too
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.
Can I merge the branches and deal with this later? I would like to start running alignment of new data
Added the old 2p alignment function to fimpy: