Skip to content
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

Multichannel tif cli #15

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

kbestak
Copy link

@kbestak kbestak commented Aug 7, 2024

Hi @Yu-AnChen,

As we discussed quite a while ago, here is the CLI for registration of multiple-cycle multichannel ome tif files.

The main changes are the palom/cli/align_multiple_cycles.py script with an example usecase and parameters added to the README.md. In addition, I've updated the pyproject.toml file accordingly.

Let me know what you think and if this is of interest.

We're in the process of adding Palom in the expansion of nf-core/mcmicro as a parallel option to ASHLAR for users with prestitched images.
In relation, as raised here: #14, one prerequisite for a fully standardized nf-core module is a license, would you mind updating Palom with one?
Second, the standardization would require a Docker image, so either pushing Palom to Biocontainers, or having a CI that pushes a Docker image on the github image repository would be very helpful (there is an old PR still open from Florian Wuennemann addressing this). We would be willing to provide support in pushing this if needed.

All the best

@Yu-AnChen
Copy link
Collaborator

Thanks so much! Will review and test this and the #7 early next week.

@kbestak
Copy link
Author

kbestak commented Aug 9, 2024

#7 is very outdated, I could set up a new github workflow if needed, let me know!

Comment on lines 118 to 119
ref_thumbnail=ref_reader.read_level_channels(1, channel).compute(),
moving_thumbnail=moving_reader.read_level_channels(1, channel).compute(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the input image is large in X-Y dimensions, using the second level (level=1) for coarse alignment will likely be inefficient and may not give good results depending on how many key-points were used. Selecting a pyramid level with reasonable size (~1000-2000 pixels in X/Y) would be more appropriate in my experiences. Happy to hear your experiences and thoughts! There's a handy function in the reader object to select a level when given a desired thumbnail image size -

palom/palom/reader.py

Lines 93 to 98 in 33f5a05

def get_thumbnail_level_of_size(self, size: float) -> int:
shapes = [
np.abs(np.mean(level.shape[1:3]) - size)
for level in self.pyramid
]
return np.argmin(shapes)

px_size = args.px_size

out_dir = pathlib.Path(args.out_dir)
img_list = [pathlib.Path(img_path) for img_path in args.img_list]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check for at least 2 images in img_list

@Yu-AnChen
Copy link
Collaborator

Thanks @kbestak - it looks great overall 👍 Just would like to learn a bit more of your cases and experiences. And thanks for the kind offer of the CI to auto-build and push the docker image. Yes, if you have an recent template that you are using, please help me update #7 or start a new PR :)

@Yu-AnChen Yu-AnChen force-pushed the main branch 2 times, most recently from 70a2103 to 2475de5 Compare October 10, 2024 05:13
@kbestak
Copy link
Author

kbestak commented Dec 2, 2024

Thanks a lot for the feedback (and apologies for the slow response...)!
The reference thumbnail was a good point to raise that I overlooked to reintegrate, so it's applied now, and I've added the img_list check.

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.

4 participants