[ITK] Colocalization of bacteria and lysosome

Michael Meuli michael.meuli at gmail.com
Mon Dec 8 07:07:47 EST 2014


Hi all

I've written a little program to analyse the colocalization of
bacteria and lysosome within macrophages. As main result it should
write the mean values of pixels located in the objects (bacteria) but
taking the value from the channel used to visualize the lysosomes
(image3Dred) into a file.
Image acquisition is done with a fancy confocal laser scanning
microscope. Bacteria, lysosomes and the nuclei of the macrophages are
labeld with different fluorochromes. As the cells are seeded as
monolayer, the images are quite flat and maximum intensity projections
are done to visually check the result.

The programm compiles and runs but I'm not yet fully convinced if it
does what it should do.
I'm not a professional programmer and wanted to ask if some itk guru
could have a look at it.
The programm and some more information can be found here:

https://github.com/michaelmeuli/bactelize

My main question is, if the following piece of code really does what
it shoud do:

BinaryImageToShapeLabelMapFilterType::Pointer
binaryImageToShapeLabelMapFilter =
BinaryImageToShapeLabelMapFilterType::New();
binaryImageToShapeLabelMapFilter->SetInput(binaryimage3Dbacteria);
binaryImageToShapeLabelMapFilter->Update();
...
StatisticsLabelMapFilterType::Pointer statisticsLabelMapFilter =
StatisticsLabelMapFilterType::New();
statisticsLabelMapFilter->SetInput1(binaryImageToShapeLabelMapFilter->GetOutput());
statisticsLabelMapFilter->SetInput2(image3Dred);
statisticsLabelMapFilter->InPlaceOn();
statisticsLabelMapFilter->Update();

unsigned int bacteriacount =
statisticsLabelMapFilter->GetOutput()->GetNumberOfLabelObjects();
for(unsigned int i = 0; i <
statisticsLabelMapFilter->GetOutput()->GetNumberOfLabelObjects(); i++)
{
StatisticsLabelMapFilterType::OutputImageType::LabelObjectType*
labelObjectMe =
statisticsLabelMapFilter->GetOutput()->GetNthLabelObject(i);
double mean = labelObjectMe->GetMean();
fileout << mean << "\t";
std::cout << "Mean value of object with label " <<
static_cast<int>(labelObjectMe->GetLabel()) << " in lysosomechannel: "
<< mean << std::endl;
}
fileout << "\n";
fileout.close();
std::cout << "Total bacteria counted (in statisticsLabelMapFilter): "
<< bacteriacount << std::endl;
std::cout << std::endl;


Do I really get the mean value from within my objects (bacteria) but
calculating it using the values in image3Dred because I did:
statisticsLabelMapFilter->SetInput2(image3Dred);
and
double mean = labelObjectMe->GetMean();

Best regards
Michael Meuli


More information about the Community mailing list