Analysis of diffuse and uneven muscle staining



Dear all,

My work is to fibertype muscle sections using immunofluorescence. This is what I stained for: Blue for the edges of individual fibers, green for a specific type of fibers (type IIa) and red for type IIb fibers. The attached figures were obtained using TileScan functions (several pictures joined together) for Blue. For Green and Red figures I uploaded only the individual images.

My pipeline works well when identify the individual number of fibers (Blue image) but sometimes individual fibers are splited into 2. I should have overcome this using MaskImage but the problem remains. Overall this is not a major issue as I can refine the staining or obtained a better picture quality. This pipeline attached was done for this purpose.

When I try to identify objects manually or corrected those that were split, the coloured edges of the object does not come out. The only available option is to press F. Please, let me know what I am doing wrong.

Individual fibers may either be positive to green, red or both. When positive to both colours they may colocalise or not. The staining for green or red is diffuse and fibers present different intensity to the staining. Some are very bright while other do not. Inside the fiber types, they also differ in their morphology. Furthermore, the green or red staining may or may not cover the complete size of the fiber.

Please, I’d like you to help me with:

The pictures need to be in high quality and be analysed as a total. The issue is that they are very heavy (100Mb) and the processing takes time. I tried reducing the quality or rescale but does not work properly. When I save the images in PNG I do not get the same quantification of fibers. What else could I do?
As I have the total number of fibers and their properties (size, etc), I want to have the same for the green, red and those positive for both. The segmentation of each of them is not proper as you can see if look at the blue channel.
Please note that the pipeline attach is for the Blue channel of the Tilescan no for the individual images, which have the red and green colour. If provide me an email I will send the TIFF image of the Tilescan.Or you may suggest how to do it with the images attach and I modify the diameter.

I sincerely hope you can give me some clues.

Best regards,

Practise34_julian_Tile_scan.cpproj (426.2 KB)


Hello there,

Can you grant us the access to your images, I currently don’t have permission to view it yet.



Dear Minh,

You have access now. Thanks in advance.Alan



The high resolution of the image is quite impressive ! But it indeed makes every test run a lengthy one.

I suggest to try the following steps:

You may have to tune the smoothing size and distance between local maxima to solve undersegmentation / oversegmentation
The huge image size really makes this tuning difficult though…

Here is the demonstrating pipeline musclefibers.cpproj (645.7 KB)

Good luck

Possible to Identify Objects Within Tertiary Object
Issues with muscle fiber histology analysis

:clap: very nice! I think this pipeline neatly demonstrates the utility of masking, and the occasional need to invert an image to take advantage of the watershed algorithm.

Since the image is so big I wonder if you’d see any performance boost by down-sampling the image, processing it, and than resizing the binary image that would then become the mask of the full size image.


Downsampling and resizing the mask is a neat idea ! Thanks Kyle !


Dear Minh,

The pipeline works perfectly fine but I wonder how you got some of the manual values (May be it is just practise !!!). Also, I run your pipeline and it gave me 4104 acepted objects not 4204 as you showed there. I may play a little bit though. You have helped me a lot to identify each fiber´s edge. Thanks a lot for that.

So, going back to one of initial questions about the staining of individual fibers. As you may see in the pics attached, how can I segmentate each individual fiber that is positive for both green and red staining but do not colocalise?

Best regards and sorry for the delay in my reply.




I guess you mean the “manual values” as those parameters for segmentation? Yes, I think we all just need to play around with different values to come down to a good one.

Regarding red and green: I suggest to do an ImageMath in which you add Red and Green channels together, to form a new “Sum” channel.
This “Sum” channel will be then used as the signal for segmentation fibers. This way, any resultant segmented fiber objects will has at least Red or green signal, no mater they are overlapped or not.
You then add all necessary measurements for these segmented objects, e.g. MeasureObjectIntensity, MeasureObjectSizeShape, MeasureTexture and MeasureCorrelation , in which you choose the images to measure to be original Red and original Green channels.

I imagine that in the end, if you plot a 2-D plot for these objects, with X axis = ratio Red intensity/Green intensity, Y axis for Area, you will see that:

  • A fiber that has both Red and Green, they will be near center, on X axis
  • A fiber that has more Red will be on the right side, on X axis
  • A fiber that has more Green will be closer to 0, on X axis.

You can even do 3-D plot with at least 1 axis with this ratio, and 2 other axes for e.g. area and texture… to see what comes out.

Hope it helps.


Ok I´ll try this. Thanks for your help I really appreciate it. Alan


Hi all,

I have images for muscle fibers stained with laminin like this one:

I’m trying to follow the pipeline suggested by @Minh but I’m not getting a proper fiber count.

I’m not sure which parameters I should modify… any suggestions will be very welcome!!

Thank you very much in advance.



this is an example

Count nuclei and capillars in two different muscle fiber types

Hi @ge2sasag, as you noted, while the same principals of @Minh’s pipeline will apply to your images, some parameters need to be adjusted to fit the particulars of your image. Here is the result of a pipeline tailored for your image: image

Here is the pipeline: musclefibers.cpproj (404.1 KB)

To adjust for the over segmentation you found, adjust the Suppress local maxima that are closer than this minimum allowed distance to be on the same scale of the largest objects you are interested in. The 90th percentile diameter shown in the segmentation is 184 pixels, and I suppressed maxima closer than 200; I kept increasing this number until I saw the over-segmentation disappear. The Size of smoothing filter is also an important number, but increasing this value too much will lead to under-segmentation. The smoothing filter size should be large enough to blend clustered maxima that result from noise nearby a true maxima. Finally, note that I added some processing of the laminin image to enhance the boundaries. I hope this helps!



Hi @karhohs, thanks a lot for your explanation! I was trying to modify those parameters but I didn’t understand properly how to increase or decrease them, now with your explanation is more clear. I also have this kind of images, in one of them I have the cytoplasm of the cell stained in green. For these ones, should I use Smooth first to make the cells more uniform? The other are stained capillars, and since some of them are cut transversally and others are longitudinally, I’m not sure how to process it.


@ge2sasag Please see the other thread you created Count nuclei and capillars in two different muscle fiber types