home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / medical-image-faq / part1 next >
Internet Message Format  |  2003-12-22  |  31KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!news-hog.berkeley.edu!ucberkeley!news2.epix.net!news1.epix.net!dclunie.com
  2. Newsgroups: alt.image.medical,comp.protocols.dicom,sci.data.formats,alt.answers,comp.answers,sci.answers,news.answers
  3. Message-ID: <20031221091625.3015.1@dclunie.com>
  4. Expires: 21 Jan 2004 00:00:00 GMT
  5. Subject: Medical Image Format FAQ, Part 1/8
  6. From: dclunie@dclunie.com (David A. Clunie)
  7. Followup-To: alt.image.medical
  8. Reply-To: dclunie@dclunie.com (David A. Clunie)
  9. Approved: news-answers-request@MIT.EDU
  10. Summary: This posting contains answers to the most Frequently Asked
  11.          Question on alt.image.medical - how do I convert from image
  12.          format X from vendor Y to something I can use ? In addition
  13.          it contains information about various standard formats.
  14. Lines: 729
  15. Date: Sun, 21 Dec 2003 14:16:25 GMT
  16. NNTP-Posting-Host: 216.37.230.197
  17. X-Complaints-To: abuse@epix.net
  18. X-Trace: news1.epix.net 1072016185 216.37.230.197 (Sun, 21 Dec 2003 09:16:25 EST)
  19. NNTP-Posting-Date: Sun, 21 Dec 2003 09:16:25 EST
  20. Xref: senator-bedfellow.mit.edu alt.image.medical:12454 comp.protocols.dicom:11710 sci.data.formats:3059 alt.answers:70768 comp.answers:55773 sci.answers:15694 news.answers:263499
  21.  
  22. Archive-name: medical-image-faq/part1
  23. Posting-Frequency: monthly
  24. Last-modified: Sun Dec 21 09:16:25 EST 2003
  25. Version: 4.26
  26.  
  27. This message is automatically posted once a month to help readers looking
  28. for information about medical image formats. If you don't want to see this
  29. posting every month, please add the subject line to your kill file.
  30.  
  31. Contents:
  32.  
  33.     part1    - contains index, general information & standard formats
  34.     part2    - contains standard formats (continued)
  35.     part3    - contains information about proprietary CT formats
  36.     part4    - contains information about proprietary MR formats
  37.     part5    - contains information about proprietary other formats
  38.     part6    - contains information about hosts & compression
  39.     part7    - contains general information sources
  40.     part8    - contains DICOM information sources
  41.  
  42. Tools that describe and convert many of the formats described in this document are available in the dicom3tools package from
  43.  
  44.     "http://www.dclunie.com/dicom3tools.html".
  45.  
  46. A web browsable version of this FAQ is available at:
  47.  
  48.     "http://www.dclunie.com/medical-image-faq/html/"
  49.  
  50. or at the mirror sites:
  51.  
  52.     "http://www.focus-fr.com/links/faq/medical/"
  53.     "http://www.focus-fr.com/links/"
  54.  
  55. Html and text forms of the FAQ are available at (postscript and pdf no longer provided):
  56.  
  57.     "http://www.dclunie.com/medical-image-faq/".
  58.  
  59. Many FAQs, including this Listing, are available on the archive sites:
  60.  
  61.     "ftp://rtfm.mit.edu/pub/usenet/news.answers/medical-image-faq/"
  62.     "http://www.faqs.org/faqs/medical-image-faq/part1/"
  63.     "http://www.cs.uu.nl/wais/html/na-dir/medical-image-faq/part1.html"
  64.     "ftp://ftp.univ-lille1.fr/pub/faq/medical-image-faq/part1"
  65.     "http://www.pasteur.fr/infosci/FAQ/medical-image-faq/part1"
  66.     "http://www.panther.net/FAQ/medical-image-faq/part1"
  67.     "http://faqs.jmas.co.jp/FAQs/medical-image-faq/part1"
  68.     "http://www.han.de/usenet/medical-image-faq/part1.gz"
  69.     "http://www.landfield.com/faqs/medical-image-faq/part1/"
  70.   
  71. The name under which a FAQ is archived appears in the Archive-name line
  72. at the top of the article.
  73.  
  74. There's a mail server on the FAQ archives. You send a e-mail message to
  75. mail-server@rtfm.mit.edu containing the keyword "help" (without quotes!)
  76. in the message body. To fetch this particular FAQ send a message with the following body:
  77.  
  78.     send usenet/news.answers/medical-image-faq/part1
  79.     ...
  80.     send usenet/news.answers/medical-image-faq/part8
  81.  
  82. Please direct comments or questions and especially contributions to
  83.  
  84.     "mailto:dclunie@dclunie.com"
  85.  
  86. or reply to this article. All unknown formats and test images gratefully
  87. accepted.
  88.  
  89. Changes this issue
  90.     Add Chinese and Korean Visible Human sites Add IntuitiveImaging conformance
  91.     statement site Add PACSGear document scanning conformance statement site
  92.     Remove email addresses to minimize spam Update Tiani conformance statement
  93.     link Add UniPACS site Extensively revise conformance statement links Remove
  94.     xray.psu dead links Reorganize toolkit summary, and remove lots of dead
  95.     toolkit links Add Trevor Morgan's dicomlib toolkit Add JDCM Java DICOM
  96.     Toolkit Add PixelMed Java DICOM Toolkit Tidy up Medigration info Tidy up
  97.     OFFIS urls Add CDMEDICSPACSWEB site Add Conquest DICOM site Add JiveX site
  98.     Update UCDMC sites to http from ftp Update DICOM image sample sites Update
  99.     XMedCon PET format convertor site Update ITU T.81 text site Add transfer
  100.     syntax determination explanatuon and code Add Madena viewer site Add
  101.     idoimaging index site Add iRad Mac viewer site Add IBM conformance statement
  102.     site Comment that R Hindel and book no longer contactable Add free PACS web
  103.     site Add Apteryx Java Image I/O Plugin site Update Escape QT site Add
  104.     YourDICOM site Add MRIConvert site Add explanation of DICOM image
  105.     orientation Update JPEG 2000 resources Clean up a lot of conformance
  106.     statement links Update UID registration, and elaborate on description Revise
  107.     structured reporting resources, and add new web site Add dicomworks site Add
  108.     Almacom's J2K codec site Update Mark Nelson's data compression library site
  109.     Update TIFF spec site at Adobe Update ALI conformance site Add Sanders
  110.     ViewPlus site Update MacAngioView site Add display performance section and
  111.     AAPM TG18 reference Tidy up part 7 indentation of compression/jpeg links
  112.     Update VMS tools site Update Kodak conformance statement site Add
  113.     CardioVista viewer Add sites about reading DICOM in MATLAB Fix IHE MESA
  114.     tools site reference Add Analog Devices J2K chip
  115.  
  116. Changes last issue
  117.     Add Tiani Java Image Archive Application with source code Tidy up MultiTech
  118.     site Add Sante Viewer and Anonymizer site Update MedX site Update bicubic
  119.     spline interpolation site Update Analyze format sites Add SPM site Update
  120.     Tiani conformance statement site Add J2K book reference Add Kakadu J2K codec
  121.     site Update MultiTech Solutions web site Cull out dead links to image sites
  122.     Update ANSI UID registration address Add InviWeb DicomWorks site Update
  123.     mirror sites list Add Xinapse software and consulting site Update unuid
  124.     pathology image site Update Interfile resources Add IHE and MESA tools sites
  125.     Add DICOM SR sample sites Add reViewMD PocketPC DICOM viewer site Add RMIT
  126.     Digital Radiography page Update TrueVIEW URL Add NIH etdips 3D software site
  127.     Add Kitware vtk site Add Konica images site Add ECRI DICOM Compatability
  128.     Analysis Form site Add Marianne's DicomEdit site Add MedicView site
  129.  
  130.  
  131. The next part is table of contents.
  132.  
  133.  
  134. Subject: Contents
  135.  
  136.  
  137.  
  138. 1.  Introduction
  139.  
  140.     1.1 Objective 1.2 Types of Formats 1.3 In Desperation - Quick & Dirty Tricks
  141.  
  142. 2.  Standard Formats
  143.  
  144.     2.1 ACR/NEMA 1.0 and 2.0 2.2 DICOM 3.0
  145.  
  146.     2.2.1 Localizer lines on DICOM images
  147.  
  148.     2.3 Papyrus 2.4 Interfile V3.3 2.5 Qsh 2.6 DEFF
  149.  
  150. 3.  Proprietary Formats
  151.  
  152.     3.1 Proprietary Formats - General Information
  153.  
  154.     3.1.1 SPI (Standard Product Interconnect) 3.1.2 Siemens - Features
  155.     common to multiple families
  156.  
  157.           3.1.2.1 Siemens Vax/VMS 3.1.2.2 Siemens Sparc SunOS
  158.  
  159.               3.1.2.2.1 Starting up 3.1.2.2.2 Getting a console
  160.               3.1.2.2.3 Native images 3.1.2.2.4 Exporting images
  161.               3.1.2.2.5 Physical connection 3.1.2.2.6 Archive devices
  162.               3.1.2.2.7 Becoming root 3.1.2.2.8 Reset
  163.  
  164.  
  165.  
  166.     3.2 CT - Proprietary Formats
  167.  
  168.     3.2.1 General Electric CT
  169.  
  170.           3.2.1.1 GE CT 9800
  171.  
  172.               3.2.1.1.1 GE CT 9800 Image data 3.2.1.1.2 GE CT 9800 Tape
  173.               format 3.2.1.1.3 GE CT 9800 Raw data MR
  174.  
  175.           3.2.1.2 GE CT Advantage - Genesis
  176.  
  177.               3.2.1.2.1 GE CT Advantage Image data 3.2.1.2.2 GE CT
  178.               Advantage Archive format 3.2.1.2.3 GE CT Advantage Raw
  179.               data
  180.  
  181.           3.2.1.3 GE CT Pace 3.2.1.4 GE CT Sytec 3.2.1.5 GE CTI
  182.  
  183.     3.2.2 Siemens CT
  184.  
  185.           3.2.2.1 Siemens Somatom DR 3.2.2.2 Siemens Somatom Plus 3.2.2.3
  186.           Siemens Somatom AR
  187.  
  188.     3.2.3 Philips CT 3.2.4 Picker CT 3.2.5 Toshiba CT 3.2.6 Hitachi CT 3.2.7
  189.     Shimadzu CT 3.2.8 Elscint CT 3.2.8 Imatron CT
  190.  
  191.     3.3 MR - Proprietary Formats
  192.  
  193.     3.3.1 General Electric MR
  194.  
  195.           3.3.1.1 GE MR Signa 3.x,4.x
  196.  
  197.               3.3.1.1.1 GE MR Signa 3.x,4.x Image data 3.3.1.1.2 GE MR
  198.               Signa 3.x,4.x Tape format 3.3.1.1.3 GE MR Signa 3.x,4.x
  199.               Raw data
  200.  
  201.           3.3.1.2 GE MR Signa 5.x - Genesis
  202.  
  203.               3.3.1.2.1 GE MR Signa 5.x Image data 3.3.1.2.2 GE MR Signa
  204.               5.x Archive format 3.3.1.2.3 GE MR Signa 5.x Raw data
  205.  
  206.           3.3.1.3 GE MR Max 3.3.1.4 GE MR Vectra
  207.  
  208.     3.3.2 Siemens MR
  209.  
  210.           3.3.2.1 Siemens Magnetom GBS/GBS II
  211.  
  212.               3.3.2.1.1 Siemens Magnetom GBS/GBS II Native Format
  213.               3.3.2.1.2 Siemens Magnetom GBS/GBS II SPI Format
  214.  
  215.           3.3.2.2 Siemens Magnetom SP
  216.  
  217.               3.3.2.2.1 Siemens Magnetom SP Native Format 3.3.2.2.2
  218.               Siemens Magnetom SP SPI Format
  219.  
  220.           3.3.2.3 Siemens Magnetom Impact
  221.  
  222.               3.3.2.3.1 Siemens Magnetom Impact Native Format 3.3.2.3.2
  223.               Siemens Magnetom Impact SPI Format
  224.  
  225.           3.3.2.4 Siemens Magnetom Vision
  226.  
  227.               3.3.2.4.1 Siemens Magnetom Vision Native Format 3.3.2.4.2
  228.               Siemens Magnetom Vision SPI Format
  229.  
  230.  
  231.     3.3.3 Philips MR
  232.  
  233.           3.3.3.1 Philips Gyroscan S5 3.3.3.2 Philips Gyroscan ACS 3.3.3.3
  234.           Philips Gyroscan T5 3.3.3.4 Philips Gyroscan NT5 & NT15
  235.  
  236.     3.3.4 Picker MR 3.3.5 Toshiba MR 3.3.6 Hitachi MR 3.3.7 Shimadzu MR
  237.     3.3.8 Elscint MR
  238.  
  239.     3.4 Proprietary Workstations
  240.  
  241.     3.4.1 ISG Workstations
  242.  
  243.           3.4.1.1 Gyroview
  244.  
  245.  
  246.     3.4.2 GE Workstations
  247.  
  248.           3.4.2.1 GE Advantage Windows
  249.  
  250.  
  251.     3.5 Other Proprietary Formats
  252.  
  253.     3.5.1 Analyze From Mayo
  254.  
  255.  
  256.  
  257. 4.  Host Machines
  258.  
  259.     4.1 Data General
  260.  
  261.     4.1.1 Data General Data
  262.  
  263.           4.1.1.1 Data General Integers 4.1.1.2 Data General Floating Point
  264.  
  265.     4.1.2 Data General Operating System
  266.  
  267.           4.1.2.1 Data General RDOS 4.1.2.2 Data General AOS/VS
  268.  
  269.     4.1.3 Data General Network
  270.  
  271.     4.2 Vax
  272.  
  273.     4.2.1 Vax Data
  274.  
  275.           4.2.1.1 Vax Integers 4.2.1.2 Vax Floating Point 4.2.1.3 Vax
  276.           Strings
  277.  
  278.     4.2.2 Vax Operating System
  279.  
  280.           4.2.2.1 Vax VMS 4.2.2.2 ULTRIX 4.2.2.3 OSF
  281.  
  282.  
  283.     4.3 Sun - Sun3 68000 and Sun4 Sparc
  284.  
  285.     4.3.1 Sun Data
  286.  
  287.           4.3.1.1 Sun Integers 4.3.1.2 Sun Floating Point 4.3.1.3 Sun
  288.           Strings
  289.  
  290.     4.3.2 Sun Operating System
  291.  
  292.  
  293.  
  294. 5.  Compression Schemes
  295.  
  296.     5.1 Reversible Compression 5.2 Irreversible Compression
  297.  
  298.     5.2.1 Perimeter Encoding
  299.  
  300.     5.3 DICOM Compression
  301.  
  302.  
  303. 6.  Getting Connected
  304.  
  305.     6.1 Tapes 6.2 Ethernet 6.3 Serial Ports
  306.  
  307.  
  308. 7.  Sources of Information
  309.  
  310.     7.1 Contacts and Sites 7.2 Relevant FAQ's 7.3 Mailservers 7.4 References 7.5
  311.     Organizations and Societies 7.6 Usenet Newsgroups 7.7 DICOM Information
  312.     Sources
  313.  
  314.  
  315. 8.  Acknowledgements
  316.  
  317.  
  318.  
  319.  
  320. The next part is part1 - general information & standard formats.
  321.  
  322.  
  323. 1.  Introduction
  324.  
  325.     1.1 Objective
  326.  
  327.  
  328.     The goal of this FAQ is to facilitate access to medical images stored on
  329.     digital imaging modalities such as CT and MR scanners, and their
  330.     accompanying descriptive information.  The document is designed
  331.     particularly for those who do not have access to the necessary
  332.     proprietary tools or descriptions, particularly in those moments when
  333.     inspiration strikes and one just can't wait for the local sales person
  334.     to track down the necessary authority and go through the cycle of
  335.     correspondence necessary to get a non-disclosure agreement in place, by
  336.     which time interest in the project has usually faded, and another great
  337.     research opportunity has passed!  It may also be helpful for those keen
  338.     to experiment with home-grown PACS-like systems using their existing
  339.     equipment, and also for those who still have equipment that is still
  340.     useful but so old even the host computer vendor doesn't support it any
  341.     more!
  342.  
  343.  
  344.     There is of course no substitute for the genuine tools or descriptions
  345.     from the equipment vendors themselves, and pointers to helpful
  346.     individuals in various organizations, as well as names and catalog
  347.     numbers of various useful documents, are included here where known.
  348.  
  349.  
  350.     In addition there are several small companies that specialize in such
  351.     connectivity problems that have a good reputation and are well known.
  352.     Contact information is provided for them, though I personally have no
  353.     experience with their products and am not endorsing them.
  354.  
  355.  
  356.     Finally, great care has been taken not to include any information that
  357.     has been released under non-disclosure agreements.  What is included
  358.     here is the result of either information freely released by vendors,
  359.     handy hints from others working in the field, or in many cases close
  360.     scrutiny of hex dumps and experimentation with scanner parameters and
  361.     study of the effects on the image files.  The intent is to spread
  362.     hard-earned knowledge gained over many years amongst those new to the
  363.     field or a particular piece of equipment, not to threaten anyone's
  364.     proprietary interests, or to substitute for the technical support
  365.     available from vendors that ranges from free to extortionate, and
  366.     excellent to abysmal, depending on who your are dealing with and where
  367.     in the world you are located!
  368.  
  369.  
  370.     Please use this information in the spirit in which is intended, and
  371.     where possible contribute whatever you know in order to expand the
  372.     information to cover more vendors and equipment.
  373.  
  374.  
  375.     1.2 Types of Formats
  376.  
  377.  
  378.     Later sections will deal with the problems of getting the image files
  379.     from the modality to the workstation, but for the moment assume the
  380.     files are there and need to be deciphered.
  381.  
  382.  
  383.     Four types of information are generally present in these files:
  384.  
  385.  
  386.        - image data, which may be unmodified or compressed, - patient
  387.        identification and demographics, - technique information about the
  388.        exam, series, and slice/image.
  389.  
  390.  
  391.     Extracting the image information alone is usually straightforward and is
  392.     described in 1.3.  Dealing with the descriptive information, for example
  393.     to make use of the data for dissemination in a PACS environment, or to
  394.     extract geometry details in order to combine images into 3D datasets, is
  395.     more difficult and requires deeper understanding of how the files are
  396.     constructed.
  397.  
  398.  
  399.     There are three basis families of formats that are in popular use:
  400.  
  401.  
  402.        - fixed format, where layout is identical in each file, - block
  403.        format, where the header contains pointers to information, - tag
  404.        based format, where each item contains its own length.
  405.  
  406.  
  407.     The block format is one of the most popular, though in most cases, the
  408.     early part of the header contains only a limited number of pointers to
  409.     large blocks, the blocks are almost always in the same place and a
  410.     constant length, for standard rather than reformatted images at least,
  411.     and if one doesn't know the specifics of the layout one can get by
  412.     assumming a fixed format.  I presume this reflects the intent of the
  413.     designers to handle future expansion and revision of the format.
  414.  
  415.  
  416.     The example par excellence of the tag based format is the ACR/NEMA style
  417.     of data stream, which, though never intended as a file format per se has
  418.     proven useful as model.  See for example the sections dealing with the
  419.     ACR/NEMA standards as well as DICOM (whose creators are about to vote on
  420.     a media interchange format after all this time) and Papyrus.  ACR/NEMA
  421.     style tags are described in more detail elsewhere, but each is
  422.     self-contained and self-describing (at least if you have the appropriate
  423.     data dictionary) and contains its own length, so if you can't interpret
  424.     it you can skip it!  Very convenient.  Most file formats based on this
  425.     scheme are just concatenated series of tags, and apart from having to
  426.     guess the byte order, which is not specified (unlike TIFF which is a
  427.     similar deal for those in the "real" imaging world), and sometimes skip
  428.     a fixed length but short header, are dead easy to handle.
  429.  
  430.  
  431.     To identify such a file just do a "strings <file | grep 'ACR-NEMA'" - if
  432.     it is such a file, just look through the start of the hex dump until you
  433.     start to see the characteristic sequentially ordered pairs of 16 bit
  434.     words that identify ACR/NEMA attributes, decide the byte order, et
  435.     voila, you can pipe it into any general ACR/NEMA dumping program to see
  436.     what it contains.  If you see even group tags, they will be described in
  437.     the standard.  If you see odd group tags then they are vendor specific
  438.     and you will have to ask the vendor or correlate them with
  439.     identification information printed on the film until you figure out the
  440.     ones that are important to you.
  441.  
  442.  
  443.     1.3 In Desperation - Quick & Dirty Tricks
  444.  
  445.  
  446.     Because radiologists, radiographers, technologists, physicists and
  447.     imaging programmers are dedicated long suffering creatures who work long
  448.     hours under adverse conditions for little reward, the vendors in their
  449.     generosity have seen fit to make life a little easier, by almost
  450.     universally putting the image data at the end of the file.  Rarely you
  451.     will see files that are padded out to fixed record size boundaries (eg.
  452.     Vax VMS 512 byte records), and sometimes overlay plane data may be
  453.     stored after the image data.  Furthermore there is almost always an
  454.     option at archive time to allow for storage in an uncompressed and
  455.     totally unadulterated form.  Even in ACR/NEMA the tag for image pixel
  456.     data is numerically the highest and hence the last to appear in the
  457.     sequence which is guaranteed to be sorted.
  458.  
  459.  
  460.     They could have screwed us up totally by gratuitously adding variable
  461.     length blocks of other stuff at the end, but the only time I have
  462.     encountered this was on a Siemens Impact with the ACR/NEMA based SPI
  463.     format padded out to 512 bytes.
  464.  
  465.  
  466.     In other words, if an image is 256 by 256, uncompressed, and 12-16 bits
  467.     deep (and hence usually, though not always, stored as two bytes per
  468.     pixel), then we all know that the file is going to contain
  469.     256*256*2=131072 bytes of pixel data at the end of the file.  If the
  470.     file is say 145408 bytes long, as all GE Signa 3X/4X files are for
  471.     example, then you need to skip 14336 bytes of header before you get to
  472.     the data.  Presume row by row starting with top left hand corner raster
  473.     order, try both alternatives for byte order, deal with the 16 to 8 bit
  474.     windowing problem, and very soon you have your image on the screen of
  475.     your workstation.
  476.  
  477.  
  478.     This technique is so useful, even NIH Image for the Macintosh (an
  479.     excellent must-have free program BTW.) provides a raw import tool to do
  480.     this, and describes it in the manual using the 14336 byte offset!  This
  481.     tool is something that is sadly lacking in most commercial image
  482.     handling programs for non-medical applications, which can't import
  483.     images with more than 8 bits per channel.
  484.  
  485.  
  486.     Of course you have to live without the identification, demographic and
  487.     technique information (other than what can be derived from the file name
  488.     in some cases), but for many research and presentation purposes this is
  489.     quite adequate.
  490.  
  491.  
  492.     Occasionally one runs into clever files where four 12 bit words are
  493.     packed into three 16 bit words and one goes crazy trying to figure out
  494.     the logic of how they are packed.  The back of the old ACR/NEMA standard
  495.     describes somewhere one way in which this is done.  One should still be
  496.     able to calculate the length easily enough.
  497.  
  498.  
  499.     I haven't yet encountered a format that did nasty things like have
  500.     strips of rows seperated by padding ...  I guess we are lucky that most
  501.     images are nice powers of two or even multiples thereof (256,320,512).
  502.  
  503.  
  504.     Of course the GE CT 9800 uses perimeter encoding even when DPCM
  505.     compression is not selected, so this technique won't work.
  506.  
  507.  
  508. 2.  Standard Formats
  509.  
  510.     2.1 ACR/NEMA 1.0 and 2.0
  511.  
  512.  
  513.     ACR/NEMA Standards Publication No.  300-1985 <- ACR/NEMA 1.0 ACR/NEMA
  514.     Standards Publication No.  300-1988 <- ACR/NEMA 2.0 ACR/NEMA Standards
  515.     Publication PS2-1989 <- data compression
  516.  
  517.  
  518.  
  519.     The American College of Radiologists (ACR) and the National Electrical
  520.     Manufacturers Association (NEMA) recognized some time ago the need for
  521.     standards to facilitate multi-vendor connectivity to promote the
  522.     development of PACS and what is now referred to as Wide Area Networking.
  523.     The first such standard was version 1.0 which was released in 1985 as
  524.     ACR/NEMA Standards Publication No.  300-1985, subsequently revised
  525.     several times, then revised again and released as version 2.0 in 1988,
  526.     described in ACR/NEMA Standards Publication No.  300-1988.  There it
  527.     remained until a radically revised and reorganized approach, preserving
  528.     backward compatibility, was released during 1992-1993 as ACR/NEMA
  529.     Standards Publication PS3, also referred to as DICOM 3.
  530.  
  531.  
  532.     In the interim, to facilitate the transfer of compressed images, another
  533.     standard described in ACR/NEMA Standards Publication PS2-1989, was
  534.     released which described various means fo extending standard 300-1985 to
  535.     handle compression utilizing a broad range of reversible and
  536.     irreversible schemes.  Though this part of the standard was never
  537.     apparently implemented by anyone, and has been quietly bypassed by those
  538.     working on DICOM 3 compression, it makes very interesting reading and is
  539.     a nice summary of applicable techniques.
  540.  
  541.  
  542.     What does one need to know about ACR/NEMA 1.0 and 2.0 ?  The standards
  543.     define a mechanism along the lines of the layered ISO-OSI (Open Systems
  544.     Interconnect) model, with physical, transport/network, session, and
  545.     presentation and application layers.  Unless one actually wants to
  546.     physically connect to a device that supports the unique 50 pin
  547.     point-to-point electrical interface, then one really only needs to be
  548.     aware of how ACR/NEMA implements the presentation and application
  549.     layers, which are described in terms of a "message format".  This
  550.     message format is important to many people, not because anyone seriously
  551.     wants to connect devices in the limited fashion envisaged by these early
  552.     standards, but because many proprietary formats and other de facto
  553.     standards have adopted the ACR/NEMA message format and its corresponding
  554.     data dictionary and extension mechanisms.
  555.  
  556.  
  557.     The message format is described in sections 4, 5 and 10 of ACR/NEMA SP
  558.     300-1988 which are summarized briefly here.  Section 6 describes command
  559.     structure which is not really relevant other than that commands are also
  560.     structured in the same way as data and consume part of the data
  561.     dictionary.  You will not encounter command tags in data streams
  562.     ("messages") encapsulated in file formats though.
  563.  
  564.  
  565.     A message consists of a series of "data elements" each of which contains
  566.     a piece of information.  Each element is described by an "element name"
  567.     consisting of a pair of 16 bit unsigned integers ("group number", "data
  568.     element number").  The data stream is ordered by ascending group number,
  569.     and within each group by ascending data element number.  Each element
  570.     may occur only once in a message.  Even numbered groups describe
  571.     elements defined by the standard.  Odd numbered groups are available for
  572.     use by vendors or users, but must conform to the same structure as
  573.     standard elements.  Following the (group number, data element number)
  574.     pair is a length field that is a 32 bit unsigned even integer that
  575.     describes the number of bytes from the end of the length field to the
  576.     beginning of the next data element.
  577.  
  578.  
  579.     The last part of a data element is its value, which is defined by the
  580.     data dictionary to be an ascii (numeric AN or text AT) or binary value
  581.     (BI 16 bit or BD 32 bit).  The values may be single or multiple.
  582.     Multiple ascii values are delimited by the backslash (05CH) character.
  583.     Odd length ascii values are padded with a space (020H).
  584.  
  585.  
  586.     For example:
  587.  
  588.  
  589.         0008 0010 000C 0000 4341 2D52 454E 414D
  590.                   3120 302E
  591.  
  592.  
  593.     is data element "Recognition Code" because that is what the dictionary
  594.     defines group 0008 element 0010 to be.  The dictionary says it is of
  595.     type AT (ascii text), has a value multiplicity of single and only
  596.     enumerated values are allowed, in this case the ascii string "ACR-NEMA
  597.     2.0".  It is of length 0000000C hex or 12 bytes long.
  598.  
  599.  
  600.     The electrical interface is a 16 bit one, and hence even though 32
  601.     binary values are defined to be transmitted least significant word first
  602.     (though the order for the 32 bit length is not actually specified),
  603.     there is no mention in the standard as to how to encapsulate the message
  604.     in an 8 bit world, hence different users and vendors have chosen little
  605.     or big endian schemes.  The new DICOM standard assumes a default little
  606.     endian representation which seems to be the most appropriate considering
  607.     the old definition for 32 bit words, which specified that the least
  608.     significant 16 bit word be transmitted first.
  609.  
  610.  
  611.     Hence there are three likely possible byte orders that a vendor
  612.     interpreting the ACR/NEMA standard in a byte oriented world may have
  613.     used:
  614.  
  615.  
  616.         - little endian 16 and 32 bit words, as in DICOM 3, - big endian 16
  617.         and 32 bit words, as in DICOM 3, - big endian 16 bit words, but the
  618.         least significant half of
  619.           a 32 bit word is sent first (as per ACR/NEMA 2.0).
  620.  
  621.     The choice seems to be made usually on the basis of the native byte
  622.     order of integers on the host processor.  Most of the formats I have
  623.     encountered are one of the first two, but I did encounter one from
  624.     Philips that used the last scheme and it drove me crazy for a while,
  625.     until I appreciated the subtlety of it !  I call it "Big Bad Endian"
  626.     format in my implementation that recognizes it, but that may be a value
  627.     judgement on my part :)
  628.  
  629.     Notice particularly how this design allows one to parse the message even
  630.     if the data dictionary is not complete.  Consider an element that has an
  631.     unrecognized element name.  One cannot interpret the content of the
  632.     element and so has to ignore it.  One doesn't even know whether it
  633.     contains binary or ascii information (this is what DICOM later refers to
  634.     as "implicit representation".  despite this, the length value allows one
  635.     to skip to the next element and proceed.
  636.  
  637.  
  638.     Over the years there has been much discussion amongst those who favour
  639.     such implicit dictionary driven schemes, and those who prefer explicit
  640.     representations, including explicit description of the element type
  641.     (binary or ascii, etc.) and even the element description itself!  Some
  642.     would prefer the message to contain something like
  643.     "RecognitionCode='ACR-NEMA 2.0';" for example.  The nuclear medicine
  644.     groups have adopted a de facto standard called Interfile that makes use
  645.     of ACR/NEMA data elements, but uses such a descriptive representation.
  646.     Their argument is that the data stream is much more readable which is
  647.     true enough, and more readily extensible.
  648.  
  649.     The groups are organized as follows:
  650.  
  651.         0000 Command 0008 Identifying 0010 Patient 0018 Acquisition 0020
  652.         Relationship 0028 Image Presentation 4000 Text 6000-601E (even)
  653.         Overlay 7FE0 Pixel Data
  654.  
  655.     Some of the more interesting elements are:
  656.  
  657.         (nnnn,0000) BD S Group Length # of bytes in group nnnn (nnnn,4000)
  658.         AT M Comments
  659.  
  660.         (0008,0010) AT S Recognition Code # ACR-NEMA 1.0 or 2.0 (0008,0020)
  661.         AT S Study Date # yyyy.mm.dd (0008,0021) AT S Series Date #
  662.         yyyy.mm.dd (0008,0022) AT S Acquisition Date # yyyy.mm.dd
  663.         (0008,0023) AT S Image Date # yyyy.mm.dd (0008,0030) AT S Study Time
  664.         # hh.mm.ss.frac (0008,0031) AT S Series Time # hh.mm.ss.frac
  665.         (0008,0032) AT S Acquisition Time # hh.mm.ss.frac (0008,0033) AT S
  666.         Image Time # hh.mm.ss.frac (0008,0060) AT S Modality #
  667.         CT,NM,MR,DS,DR,US,OT
  668.  
  669.         (0010,0010) AT S Patient Name (0010,0020) AT S Patient ID
  670.         (0010,0030) AT S Patient Birthdate # yyyy.mm.dd (0010,0040) AT S
  671.         Patient Sex # M, F, O for other (0010,1010) AT S Patient Age # xxxD
  672.         or W or M or Y
  673.  
  674.         (0018,0010) AT M Contrast/Bolus Agent # or NONE (0018,0030) AT M
  675.         Radionuclide (0018,0050) AN S Slice Thickness # mm (0018,0060) AN M
  676.         KVP (0018,0080) AN S Repetition Time # ms (0018,0081) AN S Echo Time
  677.         # ms (0018,0082) AN S Inversion Time # ms (0018,1120) AN S Gantry
  678.         Tilt # degrees
  679.  
  680.         (0020,1040) AT S Position Reference # eg.  iliac crest (0020,1041)
  681.         AN S Slice Location # in mm (signed)
  682.  
  683.         (0028,0010) BI S Rows (0028,0011) BI S Columns (0028,0030) AN M
  684.         Pixel Size # row\col in mm (0028,0100) BI S Bits Allocated # eg.  12
  685.         bit for CT (0028,0101) BI S Bits Stored # eg.  16 bit (0028,0102) BI
  686.         S High Bit # eg.  11 (0028,0103) BI S Pixel Representation # 1
  687.         signed, 0 unsigned
  688.  
  689.         (7FE0,0010) BI M Pixel Data # as described by grp 0028
  690.  
  691.  
  692.     The way in which the pixel data is stored can vary tremendously, though
  693.     thankfully most users and vendors use the simple unimaginative scheme
  694.     that is shown above, ie.  1 12 bit pixel stored in the low order part of
  695.     a 16 bit word with no attempt at packing more compactly.  Following are
  696.     some examples shown in Appendix E of the standard.  Note that when one
  697.     adds the little/big endian question the permutations mount!
  698.  
  699.  
  700.     Bits Allocated = 16 Bits Stored = 12 High Bit = 11
  701.  
  702.               |<------------------ pixel ----------------->|
  703.         ______________ ______________ ______________ ______________
  704.        |XXXXXXXXXXXXXX| | | |
  705.        |______________|______________|______________|______________|
  706.         15 12 11 8 7 4 3 0
  707.  
  708.     ---------------------------
  709.  
  710.     Bits Allocated = 16 Bits Stored = 12 High Bit = 15
  711.  
  712.        |<------------------ pixel ----------------->|
  713.         ______________ ______________ ______________ ______________
  714.        | | | |XXXXXXXXXXXXXX|
  715.        |______________|______________|______________|______________|
  716.         15 12 11 8 7 4 3 0
  717.  
  718.     ---------------------------
  719.  
  720.     Bits Allocated = 12 Bits Stored = 12 High Bit = 11
  721.  
  722.        ------ 2 ----->|<------------------ pixel 1 --------------->|
  723.         ______________ ______________ ______________ ______________
  724.        | | | | |
  725.        |______________|______________|______________|______________|
  726.         15 12 11 8 7 4 3 0
  727.  
  728.  
  729.        -------------- 3 ------------>|<------------ 2 --------------
  730.         ______________ ______________ ______________ ______________
  731.        | | | | |
  732.        |______________|______________|______________|______________|
  733.         15 12 11 8 7 4 3 0
  734.  
  735.  
  736.        |<------------------ pixel 4 --------------->|<----- 3 ------
  737.         ______________ ______________ ______________ ______________
  738.        | | | | |
  739.        |______________|______________|______________|______________|
  740.         15 12 11 8 7 4 3 0
  741.  
  742.     ---------------------------
  743.  
  744.  
  745.     And so on ...  refer to the standard itself for more detail.
  746.  
  747.  
  748. The next part is part2 - standard formats (continued).
  749.  
  750.  
  751.