{"id":4484,"date":"2013-04-05T09:00:24","date_gmt":"2013-04-05T13:00:24","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=4484"},"modified":"2016-11-28T09:57:34","modified_gmt":"2016-11-28T14:57:34","slug":"3d-image-viewer","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2013\/04\/05\/3d-image-viewer\/","title":{"rendered":"3D Image Viewer"},"content":{"rendered":"<div class=\"alert alert-info\"> <span class=\"alert_icon icon-alert-info-reverse\"><\/span><p class=\"alert_heading\"><strong>Note<\/strong><\/p><p>The file submission referenced in this post is no longer available on File Exchange.<\/p><\/div>\r\n\r\n<div class=\"content\"><p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\">Jiro<\/a>'s pick this week is Imagine by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/323331\">Christian Wuerslin<\/a>.<\/p><p>This is just a cool app. It's a 3D image viewer with a well-designed user interface. I'm sure this will be useful to anyone working with slices of 3D images.<\/p><pre class=\"codeinput\">clear\r\nload <span class=\"string\">data<\/span>\r\nwhos\r\n<\/pre><pre class=\"codeoutput\">  Name      Size               Bytes  Class    Attributes\r\n\r\n  D         4-D               442368  uint8              \r\n  S         4-D             21327411  uint8              \r\n\r\n<\/pre><p>Both \"D\" and \"S\" (pardon the nondescript names) are volumes of MRI data. \"D\" is from a data set that ships with MATLAB (<tt>load mri<\/tt>).<\/p><pre class=\"codeinput\">fprintf(<span class=\"string\">'Size of D:   %d x %d x %d x %d\\n'<\/span>, size(D));\r\n<\/pre><pre class=\"codeoutput\">Size of D:   128 x 128 x 1 x 27\r\n<\/pre><p>I created \"S\" from <a href=\"http:\/\/brainweb.bic.mni.mcgill.ca\/brainweb\/\">BrainWeb: Simulated Brain Database<\/a>. They have simulated MRI data that people can use to test imaging techniques. I downloaded the \"normal brain\" data and the \"MS lesion brain\" data. I combined the two 3D MRI data, along with the difference between the two data sets, into a single variable \"S\".<\/p><pre class=\"codeinput\">fprintf(<span class=\"string\">'Size of S:   %d x %d x %d x %d\\n'<\/span>, size(S));\r\n<\/pre><pre class=\"codeoutput\">Size of S:   181 x 217 x 181 x 3\r\n<\/pre><p>Here's a peek at what this app can do. A few points to note:<\/p><div><ul><li>If you load in a 3D data set, you can scroll through the different slices using the scroll wheel on your mouse. You can also rotate to a different angle.<\/li><li>The 4th dimension is displayed in different panels, and the data sets can be explored in sync.<\/li><li>You can create custom analyses for a line profile or a polygon ROI. The tool comes with a default analysis routine, which you can see in the animation below.<\/li><\/ul><\/div><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_imagine\/imagine_animation.gif\" alt=\"\"> <\/p><p>He also includes a Users Manual that will get you up and running right away. Thanks for making an already easy-to-use tool even easier, Christian!<\/p><p><b>Comments<\/b><\/p><p>Let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=4484#respond\">here<\/a> or leave a comment for Christian.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_12f044f77099481fbd1326bb6458d2b7() {\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='12f044f77099481fbd1326bb6458d2b7 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 12f044f77099481fbd1326bb6458d2b7';\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_12f044f77099481fbd1326bb6458d2b7()\"><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\n12f044f77099481fbd1326bb6458d2b7 ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\r\n% Jiro>'s pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/40440 Imagine> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/323331\r\n% Christian Wuerslin>.\r\n%\r\n% This is just a cool app. It's a 3D image viewer with a\r\n% well-designed user interface. I'm sure this will be useful to anyone\r\n% working with slices of 3D images.\r\n\r\nclear\r\nload data\r\nwhos\r\n\r\n%%\r\n% Both \"D\" and \"S\" (pardon the nondescript names) are volumes of MRI data.\r\n% \"D\" is from a data set that ships with MATLAB (|load mri|).\r\n\r\nfprintf('Size of D:   %d x %d x %d x %d\\n', size(D));\r\n\r\n%%\r\n% I created \"S\" from <http:\/\/brainweb.bic.mni.mcgill.ca\/brainweb\/ BrainWeb:\r\n% Simulated Brain Database>. They have simulated MRI data that people can\r\n% use to test imaging techniques. I downloaded the \"normal brain\" data and\r\n% the \"MS lesion brain\" data. I combined the two 3D MRI data, along with\r\n% the difference between the two data sets, into a single variable \"S\".\r\n\r\nfprintf('Size of S:   %d x %d x %d x %d\\n', size(S));\r\n\r\n%%\r\n% Here's a peek at what this app can do. A few points to note:\r\n%\r\n% * If you load in a 3D data set, you can scroll through the different\r\n% slices using the scroll wheel on your mouse. You can also rotate to a\r\n% different angle.\r\n% * The 4th dimension is displayed in different panels, and the data sets\r\n% can be explored in sync.\r\n% * You can create custom analyses for a line profile or a polygon ROI. The\r\n% tool comes with a default analysis routine, which you can see in the\r\n% animation below.\r\n%\r\n% <<imagine_animation.gif>>\r\n%\r\n% He also includes a Users Manual that will get you up and running right\r\n% away. Thanks for making an already easy-to-use tool even easier,\r\n% Christian!\r\n%\r\n% *Comments*\r\n%\r\n% Let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=4484#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/40440#comments\r\n% comment> for Christian.\r\n\r\n##### SOURCE END ##### 12f044f77099481fbd1326bb6458d2b7\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_imagine\/imagine_animation.gif\" onError=\"this.style.display ='none';\" \/><\/div><p> NoteThe file submission referenced in this post is no longer available on File Exchange.\r\n\r\nJiro's pick this week is Imagine by Christian Wuerslin.This is just a cool app. It's a 3D image viewer... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2013\/04\/05\/3d-image-viewer\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/4484"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=4484"}],"version-history":[{"count":11,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/4484\/revisions"}],"predecessor-version":[{"id":8090,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/4484\/revisions\/8090"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=4484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=4484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=4484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}