Skip to content

Conversation

@EmilieDel
Copy link
Contributor

No description provided.

@EmilieDel EmilieDel requested a review from jankrepl May 13, 2022 11:58
warnings.filterwarnings("ignore")


class SagittalInterpolator:
Copy link
Contributor

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 CoronalInterpolator and SagittalInterpolator are 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):
Copy link
Contributor

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,
Copy link
Contributor

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.

from skimage.color import rgb2gray
from skimage.filters import threshold_otsu
from skimage.transform import resize
from atldld.sync import DatasetDownloader
Copy link
Contributor

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")
Copy link
Contributor

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))):
Copy link
Contributor

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.

DATA_FOLDER = "../data/"
CCF_version = args.ccf

dl_global_path = join(DATA_FOLDER, "atlalign/global/boring_bear/")
Copy link
Contributor

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


# List of ISH experiment ids according to the AIBS API
# ish experiments used in Rodarie et al. 2022
genelist = [868, 1001, 77371835, 479]
Copy link
Contributor

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

# 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"]
Copy link
Contributor

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

# 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)]
Copy link
Contributor

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

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.

2 participants