{"id":3556,"date":"2012-05-18T08:41:12","date_gmt":"2012-05-18T13:41:12","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=3556"},"modified":"2012-05-18T08:41:12","modified_gmt":"2012-05-18T13:41:12","slug":"read-medical-files","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2012\/05\/18\/read-medical-files\/","title":{"rendered":"Read Medical Files"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction><\/introduction>\r\n   <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/911\">Brett<\/a>'s Pick this week is the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/29344-read-medical-data-3d\">Medical Data Reader,<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/29180\">Dirk-Jan Kroon<\/a>.\r\n   <\/p>\r\n   <p>When I first saw <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/93134\">Sean de Wolski's<\/a> recommendation of Dirk-Jan's suite of medical file readers for Pick-of-the-Week recognition, I kicked myself; I should have\r\n      thought of that one on my own. (I'm sure I would have gotten around to it eventually, but sooner is better--thanks for the\r\n      suggestion, Sean. Your swag is on the way!)\r\n   <\/p>\r\n   <p>My background is in medical research, and in my role as an application engineer, I regularly have opportunities to work with\r\n      a lot of our medically-oriented customers. The medical field is teeming with specialized data formats--many of which we don't\r\n      have pre-packaged readers for--and I've steered users to this file numerous times since Dirk-Jan first shared it.\r\n   <\/p>\r\n   <p>When I present MATLAB to prospective users, I often point out that we provide access to low-level functions like <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2012a\/techdoc\/ref\/fopen.html\"><tt>fopen<\/tt><\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2012a\/techdoc\/ref\/fread.html\"><tt>fread<\/tt><\/a>, and that the lack of a pre-built data reader should rarely (if ever) prevent anyone from analyzing their data in the MATLAB\r\n      environment. If there's a spec available for the file, it's often not too difficult to create a custom file reader.\r\n   <\/p>\r\n   <p>Easier still, though, is finding that someone else has coded the file reader for you! In this package--one of his many\r\n      highly-rated File Exchange submissions--Dirk-Jan provides read capabilities for file of type: DICOM ( .dcm , .dicom ), V3D\r\n      Philips Scanner ( .v3d ), GIPL Guys Image Processing Lab ( .gipl ), HDR\/IMG Analyze ( .hdr ), ISI ( .isi ) , NifTi (\r\n      .nii ), RAW ( .raw , .* ), VMP BrainVoyager ( .vmp ), XIF HDllab\/ATL ultrasound ( .xif ), VTK Visualization Toolkit\r\n      ( .vtk ), Insight Meta-Image ( .mha, .mhd ), Micro CT ( .vff ), and PAR\/REC Philips ( .par, .rec). (Note that support for\r\n      <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2012a\/toolbox\/images\/rn\/bqnw2j_-1.html#bqnw2_h-1\">reading, writing, and querying DICOM files<\/a> is provided by the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2012a\/toolbox\/images\/images_product_page.html\">Image Processing Toolbox<\/a>.)\r\n   <\/p>\r\n   <p>Sean wrote of Dirk-Jan's file: \"It&#8217;s reliably had a function for every file type I&#8217;ve had to work with. In addition it&#8217;s well\r\n      written and user-friendly.\" Nice synopsis, Sean! And thanks for the great effort, Dirk-Jan!\r\n   <\/p>\r\n   <p>Please continue to <a href=\"https:\/\/blogs.mathworks.com\/pick\/2012\/04\/13\/what-is-your-favorite-unrecognized-file-exchange-submission\/\">steer us to your favorite File Exchange submissions<\/a> ...we'll continue to consider your recommendations for Pick-of-the-Week recognition!\r\n   <\/p>\r\n   <p>As always, <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=3556#respond\">comments to this blog post<\/a> are welcome. Or leave a comment for Dirk-Jan <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/29344-read-medical-data-3d#comments\">here<\/a>.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_291e69aa9dd04a4d8ffb02d0a712c224() {\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='291e69aa9dd04a4d8ffb02d0a712c224 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 291e69aa9dd04a4d8ffb02d0a712c224';\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        author = 'Brett Shoelson';\r\n        copyright = 'Copyright 2012 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 author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\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      \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_291e69aa9dd04a4d8ffb02d0a712c224()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.14<br><\/p>\r\n<\/div>\r\n<!--\r\n291e69aa9dd04a4d8ffb02d0a712c224 ##### SOURCE BEGIN #####\r\n%% Read Medical Files\r\n%% \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/911 Brett>'s Pick this week is the\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/29344-read-medical-data-3d Medical Data Reader,> by \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/29180 Dirk-Jan Kroon>.\r\n\r\n%%\r\n% When I first saw <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/93134 Sean de Wolski's> \r\n% recommendation of Dirk-Jan's suite of medical file readers for Pick-of-the-Week recognition,\r\n% I kicked myself; I should have thought of that one on my own. (I'm sure I would have gotten around to it eventually, \r\n% but sooner is betterREPLACE_WITH_DASH_DASHthanks for the suggestion, Sean. Your swag is on the way!) \r\n\r\n%%\r\n% My background is in medical research, and in my role as an\r\n% application engineer, I regularly have opportunities to\r\n% work with a lot of our medically-oriented customers. The\r\n% medical field is teeming with specialized data formatsREPLACE_WITH_DASH_DASHmany\r\n% of which we don't have pre-packaged readers forREPLACE_WITH_DASH_DASHand I've\r\n% steered users to this file numerous times since\r\n% Dirk-Jan first shared it.\r\n\r\n%%\r\n% When I present MATLAB to prospective users, I often point\r\n% out that we provide access to low-level functions like\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2012a\/techdoc\/ref\/fopen.html |fopen|> and <https:\/\/www.mathworks.com\/help\/releases\/R2012a\/techdoc\/ref\/fread.html |fread|>, and that the lack of a pre-built data\r\n% reader should rarely (if ever) prevent anyone from\r\n% analyzing their data in the MATLAB environment. If there's\r\n% a spec available for the file, it's often not too\r\n% difficult to create a custom file reader.\r\n\r\n%%\r\n% Easier still, though, is finding that someone else has\r\n% coded the file reader for you! In this packageREPLACE_WITH_DASH_DASHone of his many highly-rated\r\n% File Exchange submissionsREPLACE_WITH_DASH_DASHDirk-Jan provides read capabilities for\r\n% file of type: DICOM ( .dcm , .dicom ), V3D Philips Scanner ( .v3d ), \r\n% GIPL Guys Image Processing Lab ( .gipl ), HDR\/IMG Analyze ( .hdr ),\r\n% ISI ( .isi ) , NifTi ( .nii ), RAW ( .raw , .* ),  \r\n% VMP BrainVoyager ( .vmp ), XIF HDllab\/ATL ultrasound ( .xif ), \r\n% VTK Visualization Toolkit ( .vtk ), Insight Meta-Image ( .mha, .mhd ), \r\n% Micro CT ( .vff ), and PAR\/REC Philips ( .par, .rec).\r\n% (Note that support for <https:\/\/www.mathworks.com\/help\/releases\/R2012a\/toolbox\/images\/rn\/bqnw2j_-1.html#bqnw2_h-1 reading, writing, and querying DICOM files> \r\n% is provided by the <https:\/\/www.mathworks.com\/help\/releases\/R2012a\/toolbox\/images\/images_product_page.html Image Processing Toolbox>.) \r\n\r\n%%\r\n% Sean wrote of Dirk-Jan's file: \"It\u00e2\u20ac\u2122s reliably had a\r\n% function for every file type I\u00e2\u20ac\u2122ve had to work with. In\r\n% addition it\u00e2\u20ac\u2122s well written and user-friendly.\" Nice\r\n% synopsis, Sean! And thanks for the great effort, Dirk-Jan!\r\n\r\n%%\r\n% Please continue to <https:\/\/blogs.mathworks.com\/pick\/2012\/04\/13\/what-is-your-favorite-unrecognized-file-exchange-submission\/ steer us to your favorite File Exchange submissions>\r\n% ...we'll continue to consider your recommendations for Pick-of-the-Week recognition!\r\n\r\n%% \r\n% As always, <https:\/\/blogs.mathworks.com\/pick\/?p=3556#respond comments to this blog post> are welcome. Or leave a\r\n% comment for Dirk-Jan\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/29344-read-medical-data-3d#comments here>.\r\n\r\n##### SOURCE END ##### 291e69aa9dd04a4d8ffb02d0a712c224\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n   Brett's Pick this week is the Medical Data Reader, by Dirk-Jan Kroon.\r\n   \r\n   When I first saw Sean de Wolski's recommendation of Dirk-Jan's suite of medical file readers for... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2012\/05\/18\/read-medical-files\/\">read more >><\/a><\/p>","protected":false},"author":34,"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\/3556"}],"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\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=3556"}],"version-history":[{"count":17,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3556\/revisions"}],"predecessor-version":[{"id":3575,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3556\/revisions\/3575"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=3556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=3556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=3556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}