2

I have two distance maps. One refers to the distance from one point to the outside (starting at 0, ending at a high number reflecting distance from one point). The other is basically equal and opposite (starts at a high number, ends at 0, reflecting distance from the opposite point). There is a point between the two where they are equidistant.

I want to split a central region based on relative distance between these two maps. This is relatively easy if one was only to base this division on the point where the two maps are equidistant, because if the difference between distance map 1 and distance map 2 > 0, then this would qualify as one zone. If the difference between distance map 1 and distance map 2 equal to or < 0, then this would qualify as the other zone. This is displayed in image 3 (Taken from A PDE Approach for Thickness, Correspondence, and Gridding of Annular Tissues, by Yezzi & Prince, 2002).

However, I am trying to do this for three equidistant zones. I am wondering if there is any way this could be achieved using MATLAB code. I am unfortunately not mathematically inclined... however there is this paper [ https://link-springer-com/chapter/10.1007/3-540-47979-1_39 ] that explains how this could be done on a more mathematical & theoretical level.

The rationale for this is because I can create equidistant regions between two points for all participants, instead of employing a fixed unilateral distance that is susceptible to brain changes.

I have so far tried this code:

function Out = test_wmhs_BD(Mask_WMH,Mask_WM,Dmap_Vent,Dmap_Cort)

if ~isequal(size(Mask_WMH),size(Mask_WM),size(Dmap_Vent),size(Dmap_Cort))
    disp('Dimension of inputs must match.');
    Out=[];
    
else
    bd=Dmap_Cort-Dmap_Vent;
    bdThird = bd/3;
    Out((bd < bdThird) && Mask_WMH==1) = 1;
    Out((bdThird <= bd) <= bd-bdThird && Mask_WMH==1) = 2;
    Out((bd > bd-bdThird) && Mask_WMH==1) = 3;
       
end

Where Dmap_Vent refers to one distance map, and Dmap_Cort refers to the other distance map.

I basically tried to split the bilateral distance into thirds, and use conditions to say if the bilateral distance was less than a third, then classify the output as 1, if the bilateral distance was greater than one third but less than two thirds, then classify the output as 2, and if the bilateral distance was greater than two thirds, classify the output as 3.

I was expecting this to work... however I then realised that because the bilateral distance includes a zero crossing point, any division would fail because it isn't mathematically correct! (The function failed).

Edit to include pictures, all of which are screenshots from a paper: "A PDE Approach for Thickness, Correspondence, and Gridding of Annular Tissues", by Yezzi & Prince, 2002.

Image 1: Imagine the greyscale of this distance map represents distance from the central point, with the black border representing 0 distance, and increasing distance with increasing signal intensity:

Image 1: Imagine the greyscale of this distance map represents distance from the central point, with the black border representing 0 distance, and increasing distance with increasing signal intensity

Image 2: Likewise, imagine that the black border around this distance map represents 0 distance, and the distance increases the further from the outer border you go:

Image 2: Likewise, imagine that the black border around this distance map represents 0 distance, and the distance increases the further from the outer border you go

Image 3: The ideal output would be analogous to this image, except instead of two equally-sized "zones" (zone referring to equal spaced regions on either side of the drawn line), there would be three equally sized "zones", separated by two lines:

Image 3: The ideal output would be analogous to this image, except instead of two equally-sized "zones" (zone referring to equal spaced regions on either side of the drawn line), there would be three equally sized "zones", separated by two lines

These maps would be in 3D

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
CamH
  • 25
  • 5
  • Unfortunately your use of some words makes it difficult to understand what you mean. When you say “There is a point between the two where they overlap (i.e., they cross zero).” you mean to say that there is a point where they cross, as in one is larger on one side of this point, the other is larger on the other side. This point is *equidistant* from the two start points. They don’t cross zero though. Now, when you say “bilateral distance”, I don’t know what you mean. And when you say “three equidistant zones”, I don’t know what you mean. I think this is why I don’t understand your question. – Cris Luengo Apr 23 '23 at 02:50
  • I would suggest you add an explanation using more common English words that we’re more likely to understand in the same way. You could even upload a drawing to illustrate the situation, this often helps in understanding. – Cris Luengo Apr 23 '23 at 02:51
  • Are these maps 2D? If so, they cross at a line, not a point. Are you trying to divide the space between the two points into three equally large portions? In 1D this is easy. In 2D there are probably multiple different ways to divide the space that satisfy the “equally large” part, so you’ll have to refine your description of what this partition should look like. – Cris Luengo Apr 23 '23 at 02:56
  • Hi @CrisLuengo, i've updated my question and tried to improve my clarity - hopefully this helps a bit? – CamH Apr 23 '23 at 03:49

1 Answers1

1

Let's say your two distance maps are called A and B.

A > B splits the area into two regions, one where you are closer to the first edge, one where you are closer to the other. The two regions should have the same width.

To split into three regions instead, you can scale the distances appropriately. 3*A > 2*B and 2*A > 3*B would split the area at 1/3 and 2/3 of the distance, leading to three equally wide regions.

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120