[ITK] Colocalization of bacteria and lysosome
Girish Mallya Udupi
indianzeppelin at gmail.com
Mon Dec 8 10:18:31 EST 2014
Hi Michael,
That snippet of code should do what you expect (although, as Brad
suggested, it would be a good idea to validate it). "image3Dred" is used as
the feature image. This is the image from which the statistics are
calculated. The label-map input defines the regions of the feature image
for the calculations.
By the way, you could use a single filter -
BinaryImageToStatisticsLabelMapFilter [1], to achieve the same.
[1]
http://www.itk.org/Doxygen/html/classitk_1_1BinaryImageToStatisticsLabelMapFilter.html
On Mon, Dec 8, 2014 at 1:44 PM, Bradley Lowekamp <blowekamp at mail.nih.gov>
wrote:
> 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
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>
--
Regards,
Girish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20141208/9aeb9449/attachment-0001.html>
More information about the Community
mailing list