{"id":872,"date":"2013-08-28T10:42:39","date_gmt":"2013-08-28T14:42:39","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/?p=872"},"modified":"2019-11-01T09:23:50","modified_gmt":"2019-11-01T13:23:50","slug":"introduction-to-spatial-referencing","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2013\/08\/28\/introduction-to-spatial-referencing\/","title":{"rendered":"Introduction to spatial referencing"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p><i>Today's blog post was written by Alex Taylor, a developer on the Image Processing Toolbox team. Thanks, Alex!<\/i><\/p><p>In MATLAB, an image is typically represented as a numeric matrix. There are some naturally geometric image processing operations where a user may need to care about where an image is located in a coordinate system. The term \"spatial referencing\" refers to the process of defining where an image is located in some coordinate system. This blog post will explore spatial referencing and the various ways to accomplish the spatial referencing of image data in MATLAB and the Image Processing Toolbox.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#e8cc8190-8b1d-4251-8c55-bb1211f53685\">Background: The Intrinsic Coordinate System<\/a><\/li><li><a href=\"#e290f0eb-cdee-42ee-9b61-0f2be15fe298\">Spatial referencing objects: <tt>imref2d<\/tt> and <tt>imref3d<\/tt><\/a><\/li><li><a href=\"#aae5fd7b-841f-424a-9d09-68a8e7cb198c\">Properties of <tt>imref2d<\/tt><\/a><\/li><li><a href=\"#c663c529-737f-493e-a8db-560306f8e77d\">Converting between coordinate systems using spatial referencing objects<\/a><\/li><li><a href=\"#b1fd708e-df24-4604-bbe4-969a8a14c2b1\"><tt>imshowpair<\/tt> and spatial referencing<\/a><\/li><li><a href=\"#bf757917-b321-4a51-abbe-e60cea347ddd\">The future direction of spatial referencing in the Image Processing Toolbox<\/a><\/li><\/ul><\/div><h4>Background: The Intrinsic Coordinate System<a name=\"e8cc8190-8b1d-4251-8c55-bb1211f53685\"><\/a><\/h4><p>There is a consistent, default coordinate system used in MATLAB and the Image Processing Toolbox. This coordinate system is used by default for all naturally geometric operations such as image display, and geometric transformations. You can see the default coordinate system by displaying a small image and observing where the pixels are positioned within the coordinate system of the axes.<\/p><pre class=\"codeinput\">I = reshape(9:-1:1,3,3);\r\nfigure;\r\nimagesc(I);\r\ngrid <span class=\"string\">on<\/span>;\r\ncolormap <span class=\"string\">gray<\/span>\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/spatialReferencingBlogPost_01.jpg\" alt=\"\"> <p>In the default coordinate system, the center of each pixel falls on an integral value that corresponds to the one-based (column,row) subscripts of the image. For example, the center of the first pixel in I is located at coordinate (1.0,1.0).<\/p><p>In the Image Processing Toolbox, the default coordinate system is referred to as the \"intrinsic coordinate system.\" The intrinsic coordinate system is a continuous extension of the discrete column,row subscripts of an image grid. This relationship between column,row matrix subscripting is where the term \"intrinsic coordinates\" comes from. The coordinate system is intrinsic to the one based column,row indexing of MATLAB.<\/p><h4>Spatial referencing objects: <tt>imref2d<\/tt> and <tt>imref3d<\/tt><a name=\"e290f0eb-cdee-42ee-9b61-0f2be15fe298\"><\/a><\/h4><p>The spatial referencing objects <tt>imref2d<\/tt> and <tt>imref3d<\/tt> were introduced in the R2013a release of the Image Processing Toolbox to make it easier to work with 2-D and 3-D images in a non-default or \"world\" coordinate system. This blog post will focus on the 2-D case and <tt>imref2d<\/tt>. The following example defines a world coordinate system for the simple image I where the X limits of the image are [3 6] and the Y limits the image are [6 9]. The X and Y world limits can be defined in any consistent unit system. In this example, assume the world limits are defined in units of meters.<\/p><pre class=\"codeinput\">RI = imref2d(size(I));\r\nRI.XWorldLimits = [3 6];\r\nRI.YWorldLimits = [6 9];\r\n<\/pre><p>The equivalent spatial referencing object can be created in one line with a three-argument syntax.<\/p><pre class=\"codeinput\">RI = imref2d(size(I),[3 6],[6 9]);\r\n<\/pre><p>Together, an image, I, and its associated spatial referencing object, RI, describe a spatially referenced image. The imshow function accepts a spatially referenced image.<\/p><pre class=\"codeinput\">figure, imshow(I,RI,[],<span class=\"string\">'InitialMagnification'<\/span>,<span class=\"string\">'fit'<\/span>);\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/spatialReferencingBlogPost_02.jpg\" alt=\"\"> <h4>Properties of <tt>imref2d<\/tt><a name=\"aae5fd7b-841f-424a-9d09-68a8e7cb198c\"><\/a><\/h4><p>Spatial referencing objects have properties that describe various aspects of spatial referencing. The PixelExtentInWorldX and PixelExtentInWorldY properties define how large each pixel is in the world coordinate system along the X and Y dimensions. Because the XWorldLimits and YWorldLimits properties were defined in meters, the PixelExtentInWorldX and PixelExtentInWorldY properties are in units of meters.<\/p><pre class=\"codeinput\">RI.PixelExtentInWorldX\r\nRI.PixelExtentInWorldY\r\n<\/pre><pre class=\"codeoutput\">\r\nans =\r\n\r\n     1\r\n\r\n\r\nans =\r\n\r\n     1\r\n\r\n<\/pre><p>The ImageExtentInWorldX and ImageExtentInWorldY properties define the size of the image grid along the X and Y dimensions in the units of the world coordinate system.<\/p><pre class=\"codeinput\">RI.ImageExtentInWorldX\r\nRI.ImageExtentInWorldY\r\n<\/pre><pre class=\"codeoutput\">\r\nans =\r\n\r\n     3\r\n\r\n\r\nans =\r\n\r\n     3\r\n\r\n<\/pre><p>The ImageSize property defines the number of rows and columns in the associated image matrix.<\/p><pre class=\"codeinput\">RI.ImageSize\r\n<\/pre><pre class=\"codeoutput\">\r\nans =\r\n\r\n     3     3\r\n\r\n<\/pre><h4>Converting between coordinate systems using spatial referencing objects<a name=\"c663c529-737f-493e-a8db-560306f8e77d\"><\/a><\/h4><p>The spatial referencing objects have a set of related functions that can be used to convert from world coordinates to the default intrinsic coordinate system and to discrete pixel subscripts. For example, the worldToIntrinsic function can be used to find the intrinsic coordinates with the image I that correspond to the world (X,Y) coordinate (4.6,7.3).<\/p><pre class=\"codeinput\">[intrinsicX,intrinsicY] = worldToIntrinsic(RI,4.6,7.3)\r\n<\/pre><pre class=\"codeoutput\">\r\nintrinsicX =\r\n\r\n    2.1000\r\n\r\n\r\nintrinsicY =\r\n\r\n    1.8000\r\n\r\n<\/pre><p>The intrinsic coordinates that coorespond to this world coordinate pair fall at intrinsic (X,Y) location (2.1,1.8). This means that the value we are interested in is located between the first and second row and between that second and third column of the image I. The worldToSubscript function can be used to obtain the nearest integral row, column subscript into I at a given world location.<\/p><pre class=\"codeinput\">[r,c] = worldToSubscript(RI,4.6,7.3)\r\n<\/pre><pre class=\"codeoutput\">\r\nr =\r\n\r\n     2\r\n\r\n\r\nc =\r\n\r\n     2\r\n\r\n<\/pre><p>The output (row,column) location can be used to index into I to find the value of I at world (X,Y) location (4.6,7.3).<\/p><pre class=\"codeinput\">I(r,c)\r\n<\/pre><pre class=\"codeoutput\">\r\nans =\r\n\r\n     5\r\n\r\n<\/pre><p>The use of worldToSubscript to find the closest integrally valued subscript to a given world coordinate location is equivalent to performing nearest neighbor interpolation within the spatially referenced image grid.<\/p><pre class=\"codeinput\">interp2(I,intrinsicX,intrinsicY,<span class=\"string\">'nearest'<\/span>)\r\n<\/pre><pre class=\"codeoutput\">\r\nans =\r\n\r\n     5\r\n\r\n<\/pre><p>You can also use bilinear interpolation to estimate the value of I at intrinsic coordinates that fall between integral row,column indices.<\/p><pre class=\"codeinput\">interp2(I,intrinsicX,intrinsicY,<span class=\"string\">'bilinear'<\/span>)\r\n<\/pre><pre class=\"codeoutput\">\r\nans =\r\n\r\n    4.9000\r\n\r\n<\/pre><h4><tt>imshowpair<\/tt> and spatial referencing<a name=\"b1fd708e-df24-4604-bbe4-969a8a14c2b1\"><\/a><\/h4><p>The image display function <tt>imshowpair<\/tt> can be used to display overlays of image pairs and is a good example of the importance of spatial referencing in naturally geometric workflows.<\/p><p>Start with an MRI image of my knee after a running injury.<\/p><pre class=\"codeinput\">knee = dicomread(<span class=\"string\">'knee1.dcm'<\/span>);\r\n<\/pre><p>Resize the knee image by a factor of 0.5.<\/p><pre class=\"codeinput\">smallKnee = imresize(knee,0.5);\r\n<\/pre><p>Display a falsecolor overlay of each image. Note that because no spatial referencing information is specified to <tt>imshowpair<\/tt>, <tt>imshowpair<\/tt> assumes each image is in the intrinsic coordinate system. This causes each image to be aligned at the upper left corner (0.5,0.5).<\/p><pre class=\"codeinput\">figure, imshowpair(knee,smallKnee);\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/spatialReferencingBlogPost_03.jpg\" alt=\"\"> <p>There is a one input argument syntax of <tt>imref2d<\/tt> that allows for easy construction of the default spatial referencing that corresponds to an image of a given size. We can pass these spatial referencing objects to <tt>imshowpair<\/tt> to see the same visualization of each image overlayed in the intrinsic coordinate system.<\/p><pre class=\"codeinput\">Rknee    = imref2d(size(knee));\r\nRsmallKnee = imref2d(size(smallKnee));\r\nfigure, imshowpair(knee,Rknee,smallKnee,RsmallKnee);\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/spatialReferencingBlogPost_04.jpg\" alt=\"\"> <p>In this case, the physical size of the knee in the world is the same, but one of the images is sampled at half the resolution of the other. Adjusting the world limits of the resized image has the effect of simulating a case in which two images of different resolution contain a view of the same scene in the world.<\/p><pre class=\"codeinput\">RsmallKnee.XWorldLimits = Rknee.XWorldLimits;\r\nRsmallKnee.YWorldLimits = Rknee.YWorldLimits;\r\nfigure, imshowpair(knee,Rknee,smallKnee,RsmallKnee);\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/spatialReferencingBlogPost_05.jpg\" alt=\"\"> <p>Applying a shift to the world limits of one of the images simulates image misalignment due to translation.<\/p><pre class=\"codeinput\">RsmallKnee.XWorldLimits = RsmallKnee.XWorldLimits+50;\r\nfigure, imshowpair(knee,Rknee,smallKnee,RsmallKnee);\r\n<\/pre><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/spatialReferencingBlogPost_06.jpg\" alt=\"\"> <h4>The future direction of spatial referencing in the Image Processing Toolbox<a name=\"bf757917-b321-4a51-abbe-e60cea347ddd\"><\/a><\/h4><p>Older Image Processing Toolbox functions such as imshow and imtransform use the the MATLAB graphics 'XData' and 'YData' referencing system. In this system, the two element vector XData described the centers of the first and last pixel along the X extent of the image, and the YData described the centers of the first and last pixel along the Y extent of the image. See the following doc link for details: <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/creating_plots\/the-image-object-and-its-properties.html#f2-14273\">The 'XData' and 'YData' properties of the HG image object.<\/a><\/p><p>Newer Image Processing processing functions such as <tt>imshowpair<\/tt>, <tt>imregister<\/tt>, <tt>imregtform<\/tt>, and <tt>imwarp<\/tt> use spatial referencing objects instead of 'XData' and 'YData'. Moving forward, we will de-emphasize the use of 'XData' and 'YData' referencing in the Image Processing Toolbox. We will expand the use of spatial refeferencing objects in new functions and find ways to integrate spatial referencing into existing functions that are part of naturally geometric workflows.<\/p><p>Are there any Image Processing Toolbox functions in which you would like to see the introduction of spatial referencing? If so, please let us know, we would appreciate your feedback.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_64d9fd06a12b43cea83e7a95bc43483f() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='64d9fd06a12b43cea83e7a95bc43483f ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 64d9fd06a12b43cea83e7a95bc43483f';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2013 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_64d9fd06a12b43cea83e7a95bc43483f()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2013a<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2013a<br><\/p><\/div><!--\r\n64d9fd06a12b43cea83e7a95bc43483f ##### SOURCE BEGIN #####\r\n%% Introduction to spatial referencing\r\n% _Today's blog post was written by Alex Taylor, a developer on the Image\r\n% Processing Toolbox team. Thanks, Alex!_ \r\n%\r\n% In MATLAB, an image is typically represented as a numeric matrix. There\r\n% are some naturally geometric image processing operations where a user may\r\n% need to care about where an image is located in a coordinate system. The\r\n% term \"spatial referencing\" refers to the process of defining where an\r\n% image is located in some coordinate system. This blog post will explore\r\n% spatial referencing and the various ways to accomplish the spatial\r\n% referencing of image data in MATLAB and the Image Processing Toolbox.\r\n%\r\n%% Background: The Intrinsic Coordinate System\r\n%\r\n% There is a consistent, default coordinate system used in MATLAB and the\r\n% Image Processing Toolbox. This coordinate system is used by default for\r\n% all naturally geometric operations such as image display, and geometric\r\n% transformations. You can see the default coordinate system by displaying\r\n% a small image and observing where the pixels are positioned within the\r\n% coordinate system of the axes.\r\n%\r\nI = reshape(9:-1:1,3,3);\r\nfigure; \r\nimagesc(I);\r\ngrid on;\r\ncolormap gray\r\n%%\r\n% In the default coordinate system, the center of each pixel\r\n% falls on an integral value that corresponds to the one-based\r\n% (column,row) subscripts of the image. For example, the center of the\r\n% first pixel in I is located at coordinate (1.0,1.0). \r\n%\r\n% In the Image Processing Toolbox, the default coordinate system is\r\n% referred to as the \"intrinsic coordinate system.\" The intrinsic\r\n% coordinate system is a continuous extension of the discrete column,row\r\n% subscripts of an image grid. This relationship between column,row matrix\r\n% subscripting is where the term \"intrinsic coordinates\" comes from. The\r\n% coordinate system is intrinsic to the one based column,row indexing of\r\n% MATLAB.\r\n%\r\n%% Spatial referencing objects: |imref2d| and |imref3d|\r\n%\r\n% The spatial referencing objects |imref2d| and |imref3d| were introduced\r\n% in the R2013a release of the Image Processing Toolbox to make it easier\r\n% to work with 2-D and 3-D images in a non-default or \"world\" coordinate\r\n% system. This blog post will focus on the 2-D case and |imref2d|. The\r\n% following example defines a world coordinate system for the simple image\r\n% I where the X limits of the image are [3 6] and the Y limits the image\r\n% are [6 9]. The X and Y world limits can be defined in any consistent unit\r\n% system. In this example, assume the world limits are defined in units of\r\n% meters.\r\nRI = imref2d(size(I));\r\nRI.XWorldLimits = [3 6];\r\nRI.YWorldLimits = [6 9];\r\n%%\r\n% The equivalent spatial referencing object can be created in one line\r\n% with a three-argument syntax.\r\nRI = imref2d(size(I),[3 6],[6 9]);\r\n%%\r\n% Together, an image, I, and its associated spatial referencing object,\r\n% RI, describe a spatially referenced image. The imshow function accepts\r\n% a spatially referenced image.\r\nfigure, imshow(I,RI,[],'InitialMagnification','fit');\r\n\r\n%% Properties of |imref2d|\r\n%\r\n% Spatial referencing objects have properties that describe various aspects of\r\n% spatial referencing. The PixelExtentInWorldX and PixelExtentInWorldY\r\n% properties define how large each pixel is in the world coordinate system\r\n% along the X and Y dimensions. Because the XWorldLimits and YWorldLimits\r\n% properties were defined in meters, the PixelExtentInWorldX and\r\n% PixelExtentInWorldY properties are in units of meters.\r\nRI.PixelExtentInWorldX\r\nRI.PixelExtentInWorldY\r\n%%\r\n% The ImageExtentInWorldX and ImageExtentInWorldY properties define the\r\n% size of the image grid along the X and Y dimensions in the units of the\r\n% world coordinate system.\r\nRI.ImageExtentInWorldX\r\nRI.ImageExtentInWorldY\r\n%%\r\n% The ImageSize property defines the number of rows and columns in the\r\n% associated image matrix.\r\nRI.ImageSize\r\n\r\n%% Converting between coordinate systems using spatial referencing objects\r\n%\r\n% The spatial referencing objects have a set of related functions that can be used to\r\n% convert from world coordinates to the default intrinsic coordinate\r\n% system and to discrete pixel subscripts. For example, the\r\n% worldToIntrinsic function can be used to find the intrinsic coordinates\r\n% with the image I that correspond to the world (X,Y) coordinate\r\n% (4.6,7.3).\r\n[intrinsicX,intrinsicY] = worldToIntrinsic(RI,4.6,7.3)\r\n%%\r\n% The intrinsic coordinates that coorespond to this world coordinate pair\r\n% fall at intrinsic (X,Y) location (2.1,1.8). This means that the value we\r\n% are interested in is located between the first and second row and\r\n% between that second and third column of the image I. The\r\n% worldToSubscript function can be used to obtain the nearest integral\r\n% row, column subscript into I at a given world location.\r\n[r,c] = worldToSubscript(RI,4.6,7.3)\r\n%%\r\n% The output (row,column) location can be used to index into I to find the value\r\n% of I at world (X,Y) location (4.6,7.3).\r\nI(r,c)\r\n%%\r\n% The use of worldToSubscript to find the closest integrally valued\r\n% subscript to a given world coordinate location is equivalent to\r\n% performing nearest neighbor interpolation within the spatially referenced\r\n% image grid.\r\ninterp2(I,intrinsicX,intrinsicY,'nearest')\r\n%% \r\n% You can also use bilinear interpolation to estimate the value of I at\r\n% intrinsic coordinates that fall between integral row,column indices.\r\ninterp2(I,intrinsicX,intrinsicY,'bilinear')\r\n\r\n%% |imshowpair| and spatial referencing\r\n%\r\n% The image display function |imshowpair| can be used to display overlays\r\n% of image pairs and is a good example of the importance of spatial\r\n% referencing in naturally geometric workflows.\r\n%\r\n% Start with an MRI image of my knee after a running injury.\r\n%\r\nknee = dicomread('knee1.dcm');\r\n%%\r\n% Resize the knee image by a factor of 0.5.\r\nsmallKnee = imresize(knee,0.5);\r\n%%\r\n% Display a falsecolor overlay of each image. Note that because no spatial\r\n% referencing information is specified to |imshowpair|, |imshowpair| assumes\r\n% each image is in the intrinsic coordinate system. This causes each image\r\n% to be aligned at the upper left corner (0.5,0.5).\r\nfigure, imshowpair(knee,smallKnee);\r\n%%\r\n% There is a one input argument syntax of |imref2d| that\r\n% allows for easy construction of the default spatial referencing that\r\n% corresponds to an image of a given size. We can pass these spatial\r\n% referencing objects to |imshowpair| to see the same visualization of each\r\n% image overlayed in the intrinsic coordinate system.\r\nRknee    = imref2d(size(knee));\r\nRsmallKnee = imref2d(size(smallKnee));\r\nfigure, imshowpair(knee,Rknee,smallKnee,RsmallKnee);\r\n%%\r\n% In this case, the physical size of the knee in the world is the same, but\r\n% one of the images is sampled at half the resolution of the other.\r\n% Adjusting the world limits of the resized image has the effect of\r\n% simulating a case in which two images of different resolution contain a\r\n% view of the same scene in the world.\r\nRsmallKnee.XWorldLimits = Rknee.XWorldLimits;\r\nRsmallKnee.YWorldLimits = Rknee.YWorldLimits;\r\nfigure, imshowpair(knee,Rknee,smallKnee,RsmallKnee);\r\n%%\r\n% Applying a shift to the world limits of one of the images simulates image\r\n% misalignment due to translation.\r\nRsmallKnee.XWorldLimits = RsmallKnee.XWorldLimits+50;\r\nfigure, imshowpair(knee,Rknee,smallKnee,RsmallKnee);\r\n\r\n%% The future direction of spatial referencing in the Image Processing Toolbox\r\n% Older Image Processing Toolbox functions such as imshow and imtransform\r\n% use the the MATLAB graphics 'XData' and 'YData' referencing system. In\r\n% this system, the two element vector XData described the centers of the\r\n% first and last pixel along the X extent of the image, and the YData\r\n% described the centers of the first and last pixel along the Y extent of\r\n% the image. See the following doc link for details: \r\n% <https:\/\/www.mathworks.com\/help\/matlab\/creating_plots\/the-image-object-and-its-properties.html#f2-14273 The 'XData' and 'YData' properties of the HG image object.>\r\n%\r\n% Newer Image Processing processing functions such as\r\n% |imshowpair|, |imregister|, |imregtform|, and |imwarp| use spatial\r\n% referencing objects instead of 'XData' and 'YData'. Moving forward, we\r\n% will de-emphasize the use of 'XData' and 'YData' referencing in the Image\r\n% Processing Toolbox. We will expand the use of spatial refeferencing\r\n% objects in new functions and find ways to integrate spatial referencing\r\n% into existing functions that are part of naturally geometric\r\n% workflows.\r\n%\r\n% Are there any Image Processing Toolbox functions in which you would like\r\n% to see the introduction of spatial referencing? If so, please let us\r\n% know, we would appreciate your feedback.\r\n\r\n##### SOURCE END ##### 64d9fd06a12b43cea83e7a95bc43483f\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2013\/spatialReferencingBlogPost_06.jpg\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p><i>Today's blog post was written by Alex Taylor, a developer on the Image Processing Toolbox team. Thanks, Alex!<\/i>... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2013\/08\/28\/introduction-to-spatial-referencing\/\">read more >><\/a><\/p>","protected":false},"author":42,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[58,715,725,70,60,1023,1025,863,1033,156,36,867,1035,1031,170,1027,1029],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/872"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/comments?post=872"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/872\/revisions"}],"predecessor-version":[{"id":876,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/872\/revisions\/876"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}