-
Notifications
You must be signed in to change notification settings - Fork 4
Add Dimitri's script #42
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
base: master
Are you sure you want to change the base?
Conversation
| warnings.filterwarnings("ignore") | ||
|
|
||
|
|
||
| class SagittalInterpolator: |
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 would imagine this one is a just a copy of the logic from CoronalInterpolator.
Possible actions
- No action
- Write a more general linear interpolator and make sure
CoronalInterpolatorandSagittalInterpolatorare special cases - Outsource the interpolation to
atlinter
| class SagittalInterpolator: | ||
| """Interpolator that works pixel by pixel in the coronal dimension.""" | ||
|
|
||
| def __init__(self, kind="linear", fill_value=0, bounds_error=False): |
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 might as well type annotate the entire script. Should be easy
|
|
||
|
|
||
| def align_marker( | ||
| dataset_id, nvol, model_gl, header, |
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 definitely run some linters/ code formatters on it.
scripts/align_ish_data.py
Outdated
| from skimage.color import rgb2gray | ||
| from skimage.filters import threshold_otsu | ||
| from skimage.transform import resize | ||
| from atldld.sync import DatasetDownloader |
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.
Seems like everything related to Allen downloads is outsourced to atldld which is great.
| from atlalign.volume import GappedVolume, CoronalInterpolator | ||
| import scipy | ||
|
|
||
| warnings.filterwarnings("ignore") |
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.
IMO we should identify where exactly this warning is raised and do one of the following
- Filter the warning inside of a context manager
- Fix the cause of the warning
| all_dl = np.vstack((all_dl, np.copy(img_mov)[None, :, :])) | ||
|
|
||
| all_ib = [] | ||
| for i, (img_mov, sn) in tqdm(enumerate(zip(all_dl, all_sn))): |
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 it seems like we first do deep learning registration followed by intensity based. I guess we don't question it and just assume that is the best setup.
scripts/align_ish_data.py
Outdated
| DATA_FOLDER = "../data/" | ||
| CCF_version = args.ccf | ||
|
|
||
| dl_global_path = join(DATA_FOLDER, "atlalign/global/boring_bear/") |
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 would switch to pathlib
scripts/align_ish_data.py
Outdated
|
|
||
| # List of ISH experiment ids according to the AIBS API | ||
| # ish experiments used in Rodarie et al. 2022 | ||
| genelist = [868, 1001, 77371835, 479] |
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.
This could potentially be passed via the CLI
scripts/align_ish_data.py
Outdated
| # List of ISH experiment ids according to the AIBS API | ||
| # ish experiments used in Rodarie et al. 2022 | ||
| genelist = [868, 1001, 77371835, 479] | ||
| namelist = ["pvalb", "SST", "VIP", "gad1"] |
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.
This should be uniquely implied by the gene_id
scripts/align_ish_data.py
Outdated
| # ish experiments used in Rodarie et al. 2022 | ||
| genelist = [868, 1001, 77371835, 479] | ||
| namelist = ["pvalb", "SST", "VIP", "gad1"] | ||
| is_sagittal = [False for _ in range(4)] |
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.
Again, this should be uniquely implied by the gene_id
No description provided.