[ITK] Colocalization of bacteria and lysosome

Bradley Lowekamp blowekamp at mail.nih.gov
Mon Dec 8 08:44:29 EST 2014


Hello,

I am not sure anyone else can validate your code for you.

What I'd recommend is developing some test images with known answers, and then adding them at test to you code to validate the results. This testing process can easily be done with cmake and ctest.

Brad

On Dec 8, 2014, at 7:07 AM, Michael Meuli <michael.meuli at gmail.com> wrote:

> 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
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community



More information about the Community mailing list