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

Index Error in 3_measure_mask.cppipe #40

Closed
hfl112 opened this issue Jun 5, 2020 · 4 comments
Closed

Index Error in 3_measure_mask.cppipe #40

hfl112 opened this issue Jun 5, 2020 · 4 comments

Comments

@hfl112
Copy link

hfl112 commented Jun 5, 2020

Encounter an error like this:
Error while processing MeasureObjectNeighbors Multichannel: index 11 is out of bounds for axis 2 with size 11

seems like something wrong with the markers? cause I have only selected 11 markers in pannel.csv
Any advices to solve this problems might be aprreciate.
Thank you

@votti
Copy link
Collaborator

votti commented Jun 5, 2020

Hi,
This is because at this time, the number of markers need to be adapted in the measurement modules.
As described here: https://github.com/BodenmillerGroup/ImcSegmentationPipeline/blob/development/scripts/imc_preprocessing.ipynb
section 'D) Cellprofiler: 3_measure_mask'

"""
5) Measure Object Intensity Multichannel: Adapt the channel numbers for 'Fullstack' and 'Fullstackfiltered'. 'Probabstack' remains at 3. Check the _full.csv files in the tiffs folder to see how many channels the stack have and adapt accordingly.

  1. Measure Image Intensity Multichannel: Adapt the channel numbers for 'Fullstack' and 'Fullstackfiltered'. Check the _full.csv files in the tiffs folder to see how many channels the stack have and adapt accordingly.

"""
Cheers!

@hfl112
Copy link
Author

hfl112 commented Jun 5, 2020

Hi,
This is because at this time, the number of markers need to be adapted in the measurement modules.
As described here: https://github.com/BodenmillerGroup/ImcSegmentationPipeline/blob/development/scripts/imc_preprocessing.ipynb
section 'D) Cellprofiler: 3_measure_mask'

"""
5) Measure Object Intensity Multichannel: Adapt the channel numbers for 'Fullstack' and 'Fullstackfiltered'. 'Probabstack' remains at 3. Check the _full.csv files in the tiffs folder to see how many channels the stack have and adapt accordingly.

  1. Measure Image Intensity Multichannel: Adapt the channel numbers for 'Fullstack' and 'Fullstackfiltered'. Check the _full.csv files in the tiffs folder to see how many channels the stack have and adapt accordingly.

"""
Cheers!

Vito,
Thank you so much for the patience. I have successfully run through the whole imc_seg_pipe.
But I still have some questions remain:

  1. I found in your type II diabetes manuscript, you have did another segmentation to mask the blood vessel and islets in ilastik, and get the distance from cells to the rim. How to achieve this ? can you just briefly explain the steps?
  2. And I found you did the experiment to get the spillover matrix. Does this experiment have a great influence on the final results?
  3. And I found the results between using imc_seg_pipeline and using cellprofiler only is quiet different. For example, I got 400 cells from imc_seg_pipeline(ilastik+cellprofiler) and more than 600 from cellprofiler. I wanna know is this acceptable or normal under this pipeline?
    Actually using this pipeline helped me to solve the duplicate cellid problem and insufficient neighbouring cells, which derived from the bad mask.
    Thank you again for the help,
    Funan

@votti
Copy link
Collaborator

votti commented Jun 5, 2020

I answered question 1 separately in #41

At question 2: It is a bit hard to say a-priori if this will be an issue:
The effect of spillover is only really strong if you have markers that are very high in a subset cells next to markers that are very low in the same subset of cells.
Also if you want to look at marker correlations, the influence can be substantial, as spillover introduces artificial correlations.

In the end it also depends how much you want to interprete 'graded' expressions - if much of your analysis just looks at marker 'high' and 'low' cells, spillover might not be an issue.

At 3:
Please always check if you think the segmentation looks 'reasonable': I always recommend to overlay masks using the 'OverlayOutlines' or 'OverlayObjects' cellprofiler modules. E.g. extract the 'Iridium' or a membrane channel from your 'full' stack with the 'ColorToGray' module and create & save these overlay images.

Please also note that it is very much advised to play around with the 'IdentifyPrimaryObjects' settings in Cellprofiler in both a basic and CP + Ilastik pipeline to improve your segmentation.

Finally my biggest advice would be to write down some 'biological expectations' you would have from your data. E.g. markers that should never co-occur biologically in your cells. This can be a good guide to judge segmentation quality.

@hfl112
Copy link
Author

hfl112 commented Jun 8, 2020

I answered question 1 separately in #41

At question 2: It is a bit hard to say a-priori if this will be an issue:
The effect of spillover is only really strong if you have markers that are very high in a subset cells next to markers that are very low in the same subset of cells.
Also if you want to look at marker correlations, the influence can be substantial, as spillover introduces artificial correlations.

In the end it also depends how much you want to interprete 'graded' expressions - if much of your analysis just looks at marker 'high' and 'low' cells, spillover might not be an issue.

At 3:
Please always check if you think the segmentation looks 'reasonable': I always recommend to overlay masks using the 'OverlayOutlines' or 'OverlayObjects' cellprofiler modules. E.g. extract the 'Iridium' or a membrane channel from your 'full' stack with the 'ColorToGray' module and create & save these overlay images.

Please also note that it is very much advised to play around with the 'IdentifyPrimaryObjects' settings in Cellprofiler in both a basic and CP + Ilastik pipeline to improve your segmentation.

Finally my biggest advice would be to write down some 'biological expectations' you would have from your data. E.g. markers that should never co-occur biologically in your cells. This can be a good guide to judge segmentation quality.

Hi Vito,
I still got some questions in tissue-level mask. I have classified some blood vessel in ilastik, but I encounter an error in TransformBinary in Cellprofiler.

Error while processing Transform Binary:
tuple index out of range

In addition, I still can't figure out in which step to merge these 2 mask(cell segmentation & tissue-level segmentation) into a final one.

Thank you,
Funan

@hfl112 hfl112 closed this as completed Jun 10, 2020
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

No branches or pull requests

2 participants