hammerlab / cytokit

Microscopy Image Cytometry Toolkit
Apache License 2.0
115 stars 18 forks source link

how to generate a template configuration file? #41

Open amcrab opened 2 years ago

amcrab commented 2 years ago

This tool looks really cool and I'd like to implement it at our organization! However, I'm new to image analysis and cannot for the life of me figure out how to obtain/create a template configuration file for the image I wish to process.

I've managed to extract a utf-16 XML file from the qptiff tags. The XML contained a lot of information about the cameras and channels, but it doesn't have all the information contained in the example yaml config files.

What is the usual way to go about getting the template configuration file? Do you just write it from scratch and hope for the best?

eric-czech commented 2 years ago

Hi @amcrab, unfortunately there isn't a great way to manage that conversion. The usual process would be to write a script that does it once and then reapply it when necessary to get the yaml file you need.

This library can be helpful if you have a strong preference/need for CLIs and scripts, but it's not maintained anymore so you might also consider CellProfiler instead -- or look at how this library is working with CP programmatically (which is quite useful but not well documented).

amcrab commented 2 years ago

Hi Eric, thanks for the info! I was a little worried that this might be the case. However, I do a lot of CLI work which is why I am so interested to use Cytokit rather than the more GUI-centric programs.

What is the bare minimum information I would need for a functional template configuration yaml? Maybe there is a blank template for the template? I believe our organization is working with an Akoya PhenoCycler (formerly CODEX). I know the channels and their order but not a lot else. The XML I extracted is a hot mess.

-Angela

eric-czech commented 2 years ago

What is the bare minimum information I would need for a functional template configuration yaml?

If you're not going to use deconvolution, much less is needed. You can ignore objective_type, numerical_aperture, emission_wavelengths, axial_resolution, and lateral_resolution in a config like https://github.com/hammerlab/cytokit/blob/master/pub/config/cell-size/experiment_20x.yaml for that case. You'd have to figure all the other parameters out though (including magnification).

I would suggest starting with that config, adding run_deconvolution: false and modifying the channel names to look more like https://github.com/hammerlab/cytokit/blob/master/pub/config/codex-spleen/experiment.yaml. I think that should be enough to get something running.