> > |
- I'm very sorry for the delay of my answer. Honestly, I would like to thank you once again by all your efforts! I should have told you this almost two weeks ago... Please accept my apologies!
- I am sorry that my efforts have proven insufficient for you. But I feel obligated to inform you about two aspects of your data: 1. The black voxels are occurring because the creator of the ANALYZE files made a mistake. For example, in the file you ftp'ed to me, the minimum and maximum pixel values are given as (-32768,32767) when the real minimum and maximum is (-32896, 32767). Further, the creator used 16-bit precision when writing the data, so if the values are -32767, -32768, -32769, -32770 then the values written are -32767, -32768, 32767, 32766. This means that you must manually correct all values less than -32768. For example, in the code I last emailed you, you can add the lines:
if (s < -32768) {
int diff = -(32768 + s);
s = -32768 + diff;
}
after the line: int s = (b1 << 8) + (b2 << 0);
- 2. The ANALYZE file format does not contain information about the orientation of the images (there is no way to know if the images are upside down because no information exists in the file to tell us). ANALYZE files are a bad way to store patient images because we do not know left from right. The ANALYZE to DICOM translation assumes the images are oriented according to the SPM standard. Therefore, if the images are upside down or in the wrong orientation, you will need to manually correct it (hopefully all of your images are in the same orientation, so you will only need to do this once). This can be done by changing the -1,0 in the Debabeler module "Image Orientation" (whichis in the "Create DICOM Images" module. The -1,0 refer to directional cosines and set the orientation of DICOM element (0020,0037). If you read up on directional cosines or experiment with values -1,0,1, you should be able to change the orientation to your preference. But I should point out that the ANALYZE file you ftp'ed me appears to be in SPM orientation (although I can't tell if the patient's left/right is correct). You will probably find that different DICOM viewers display the same DICOM data differently (so look for the coordinate axes). Because of these two reasons, I conclude that you will not find an automatic conversion from ANALYZE to DICOM. Again, my apologies for not offering you a better solution. But perhaps the above two points will help you find what you are looking for.
- Thank you so much for your efforts, but please realize they continue to be almost useless for me. First, because I have 39 CDs (each one approximately with 45 pairs of ANALYZE files), and also because, even after trying your scrip for only one .img file, the correspondent DICOM images appear upside down and with black voxels scattered on them... Please be sure I realize your assistance means precious time for you... But, if you know a better alternative for the conversion I need, please let me know!
- The reason the DICOM images are black is that the data in the ANALYZE file is signed (both negative and positive values). The ANALYZE to DICOM translation only handles unsigned data values. I've attached a java program you can use to convert your .img file from signed to unsigned. Then the translations should work. Instructions are below.
1. compile: javac SignedToUnsigned.java
2. run: java SignedToUnsigned 003.1001.25may99.3d.vol.img temp.img
3. use new img: mv temp.img 003.1001.25may99.3d.vol.img (unix)
- I believe the ANALYZE 7.5 image data type is short (16 bits per voxel), but please find attached a pair of files to confirm this information.
- What is the datatype (byte, short, float) of the ANALYZE image?
- Sorry for bothering you again, but now that I found the output images and tried to see them with a DICOM viewer (I tried eFilm, DicomWorks, and Cheshire), they appear completely black... I can't find anything on them, even after trying to adjust the window level!...
- Thank you very much! I already realized what's happened. My mistake...and some inexperience... Sorry!
- The DICOM files should be in the same directory the ANALYZE files are in. Perhaps an error occurred during the translation? If you scroll through the message box at the bottom, there may be an error message.
- I tried several times to convert Analyze 7.5 image files into DICOM files. I used Debabeler 2.3 on a Windows XP environment for that purpose. First, I chose the xml file AnalyzeToDicom_10Sep2004 from the load mappings box, then I selected the input files and the output source (DICOM), and finally ran the program. Apparently, the translation occurred successful, but I can't find the output files?!...
Topic permissions
| META FILEATTACHMENT | SignedToUnsigned?.java | attr="" comment="" date="1154041562" path="SignedToUnsigned.java" size="1554" user="sneu" version="1.1" |
|