Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

CalcInt.m 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. function [results,Int]=CalcInt(MGstack,MGvolume,res,PunctaWanted,Pvolume_total,spMarker)
  2. MGPuncta= MGstack + PunctaWanted;
  3. MGPuncta(MGPuncta == 1) = 0;
  4. MGPuncta(MGPuncta == 2) = 1;
  5. PunctaWanted_labeled = bwlabeln(PunctaWanted,8);
  6. MGPuncta = MGPuncta .* PunctaWanted_labeled;
  7. [MGPuncta_size, ~] = histcounts(MGPuncta,1 : max(MGPuncta(:)));
  8. MGPuncta_size(MGPuncta_size<=1)=0;
  9. [PunctaWanted_size, ~] = histcounts(PunctaWanted_labeled ,1 : max(PunctaWanted_labeled(:)));
  10. PunctaWanted_size(PunctaWanted_size<=1)=0;
  11. %if parts extending Microglias
  12. if spMarker<1
  13. MGPuncta_size(MGPuncta_size<=res.pixel_width_um/10)=0;
  14. PunctaWanted_size(PunctaWanted_size<=res.pixel_width_um/10)=0;
  15. [Psize, ~] = histcounts(PunctaWanted_labeled, 1 : max(PunctaWanted_labeled(:)));
  16. MGPuncta_size(end : length(Psize)) = 0;
  17. size_ratio = MGPuncta_size ./ Psize;
  18. MGPuncta_size = find(size_ratio == 1);
  19. MGPuncta = ismember(MGPuncta,MGPuncta_size);
  20. end
  21. %% count number of inclusions and number of pixels in the intersection in the desired microglia
  22. results.number_inclusions = nnz(MGPuncta_size);
  23. results.number_inclusions_per_um = results.number_inclusions / MGvolume;
  24. results.volume_inclusions_um = sum(sum(sum(MGPuncta)))* (res.pixel_width_um*res.pixel_height_um*res.pixel_depth_um);
  25. results.volume_inclusions_per_um = results.volume_inclusions_um / MGvolume;
  26. results.microglia_volume=MGvolume;
  27. results.number_inclusions_total=nnz(PunctaWanted_size);
  28. results.volume_inclusions_total=Pvolume_total;
  29. Int=MGPuncta;