Showing 1-25 of 236 topics
Display:
Results per page:

1   2   ...   10   Next >
  • Mar 19, 2024  04:03 PM | Jiyao Liu
    dcm2niix error: Unable to decode JPEG. Please use dcmdjpeg to uncompress data.

    I want to convert dicom files to nifty files, but I got this problem.



    This is the source code:



    converter = Dcm2niix()
    converter.inputs.source_dir = source_dir
    converter.inputs.compression = 9
    converter.inputs.output_dir = output_dir
    converter.inputs.out_filename = 'DWI'
    converter.inputs.bids_format = False
    converter.run()


    Could you please help me figure it out?

    • Mar 19, 2024  05:03 PM | Chris Rorden
      RE: dcm2niix error: Unable to decode JPEG. Please use dcmdjpeg to uncompress data.

      1. You should upgrade to the latest version of dcm2niix (from 2024) instead of a version from 2021.
      2. You will want to install a version of dcm2niix that has support for compressed DICOM transfer syntaxes.

      You can get dcm2niix here:


        https://github.com/rordenlab/dcm2niix/re...


      dcm2niix can be compiled with or without support for compressed transfer syntaxes. You can see this in the first line of the output. For example, an executable that supports JPEG2000 (JP2) and JPEG-lossless (JP-LS) would report:


       


      Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) Clang12.0.0 ARM (64-bit MacOS)


      If you are unable to install a modern version of dcm2niix compiled with support for compressed images, you can decompress your images using dcmdjpeg


       


      https://support.dcmtk.org/docs/dcmdjpeg.html


       


       

  • Mar 1, 2024  06:03 PM | abinoah - University of Nottingham
    problem converting DICOM to NIFTI Newbie

    Hi,


    I am trying to convert MRI's from Dicom to Nifti


    Was going swimmingly well till I got this message


    Found 1422 DICOM file(s)
    DICOM images may be missing, expected 70 spatial locations per volume, but found 1422 slices.
    Slice positions repeated, but number of slices (1422) not divisible by number of repeats (21): missing images?
    Hint: expected 70 locations
    Warning: Interslice distance varies in this volume (incompatible with NIfTI format).
    Unable to equalize slice distances: slice order not consistently ascending.
    First spatial position repeated 21 times


    Can anyone please explain what this means and what I can do about it?


    Using MRIcroGL


    Thanks


     

    • Mar 1, 2024  07:03 PM | Chris Rorden
      RE: problem converting DICOM to NIFTI Newbie

      This looks like an issue with your images not dcm2niix. You will want to make sure that all the DICOM files from the series are in a single folder. Perhaps a disk became full so only stored part of the series. Check the provenance of your images, and convert a complete set.

  • Mar 1, 2024  12:03 PM | skhans
    How to train simple CNN model using data from COBRE dataset and get binary class (no_known_disorder and schizophrenia) predictions

    I've downloaded the COBRE datasets (that contains control AND schizophrenia data only) from Schizoconnect. It is my first time to train model with .nii file. I am confused about how to make a model from .nii dataset. So, can anyone tell me the complete steps from extracting dataset file to predicting schizophrenia? That is, after extracting, I got 90 subjects (of no_known_disorder) and similarily for schizophrenia data, and in each subject there are multiple files, so which one I have to select for training model only .nii or others too?, How to make two folders so that one folder contains only .nii files of schizophrenia and second folder contains only no_known_disorder (i.e. healthy/control files of .nii), now how to preprocess data, how to read and open/display nii files using python script, then how to divide whole data into training and test set and then apply simple CNN model to get predictions that is, whether person is schizophrenic or not? Please help me to solve this issue using python script.

    • Mar 1, 2024  02:03 PM | Chris Rorden
      RE: How to train simple CNN model using data from COBRE dataset and get binary class (no_known_disorder and schizophrenia) predictions

      This question is out of scope for this message board. I suggest you look at the neurostars message board. AFNI, FSL, FreeSurfer and SPM are all popular tools that could aid you.

  • Dec 20, 2023  09:12 AM | skhans
    DICOM to PNG/JPG/JPEG Conversion for CNN Input

    How to get images from the DICOM (.dcm) files. I'm using COBRE data that contains numerous .nii and .dcm (DICOM) files, and each DICOM file contains 30 scans of the brain. I want the PNG/JPG of each scan that is 30 images (in PNG/JPG) from a single DICOM file to use as an input for the CNN model. How to get it?

    • Dec 20, 2023  11:12 AM | Chris Rorden
      RE: DICOM to PNG/JPG/JPEG Conversion for CNN Input

      This is outside the scope of dcm2niix, which is a DICOM to NIfTI converter. You may also consider training your model directly on NIfTI images, to see an example ask ChatGPT "create a python script that opens a series of NIfTI format images and uses them with deep learning to predict participant age listed in the first column of a tsv format file." In addition, you may want to spatially normalize images prior to training to ensure a similar field of view and orientation.


       


      If you want to convert 3D images to PNG or JPG can use a tool like med2image


        https://pypi.org/project/med2image/0.2/


       


      Be aware that JPEGs are lossy and that PNG files typically use 32-bit RGBA that only provide 256 levels of gray. Converting 16-bit scalar data common to medical imaging to 8-bit gray will incur loss, and you need to consider the contrast and brightness (window center and window width in medical imaging parlance).

      • Mar 1, 2024  01:03 PM | skhans
        RE: DICOM to PNG/JPG/JPEG Conversion for CNN Input

        In addition, you may want to spatially normalize images prior to training to ensure a similar field of view and orientation. How to do this, sir?

        • Mar 1, 2024  02:03 PM | Chris Rorden
          RE: DICOM to PNG/JPG/JPEG Conversion for CNN Input

          AFNI, ANTS, FSL, SPM all have popular normalization routines. You can see their respective web pages for more details. I strongly recommend the FSL training course and its included materials.

      Mar 1, 2024  12:03 PM | skhans
      RE: DICOM to PNG/JPG/JPEG Conversion for CNN Input

      I've downloaded the COBRE datasets (that contains control AND schizophrenia data only) from Schizoconnect. It is my first time to train model with .nii file. I am confused about how to make a model from .nii dataset. So, can anyone tell me the complete steps from extracting dataset file to predicting schizophrenia? That is, after extracting, I got 90 subjects (of no_known_disorder) and similarily for schizophrenia data, and in each subject there are multiple files, so which one I have to select for training model only .nii or others too?, How to make two folders so that one folder contains only .nii files of schizophrenia and second folder contains only no_known_disorder (i.e. healthy/control files of .nii), now how to preprocess data, how to read and open/display nii files using python script, then how to divide whole data into training and test set and then apply simple CNN model to get predictions that is, whether person is schizophrenic or not? Please help me to solve this issue using python script.

  • Jun 4, 2017  09:06 PM | jack gspm
    Error: OpenJPEG j2k_to_image failed to decode
    Hi,
    Using dcm2niiX version v1.0.20170528 (OpenJPEG build) Clang8.0.0 (64-bit MacOS).
    Error: OpenJPEG j2k_to_image failed to decode
    Any ideas?
    thanks!

    jack

    • Jun 7, 2017  12:06 PM | Chris Rorden
      RE: Error: OpenJPEG j2k_to_image failed to decode
      Jack
       Thanks for bringing this to our attention. Clearly the JPEG2000 libraries are not always statically linked when the software is built with our new build system. I have sent you an executable that resolves this. Since this problem is specific to MacOS, you can also use the version of dcm2niix that is built-into MRIcro (Import menu)- this software is included with the NITRC MRIcroGL download. 

      While dcm2niix can (will) be able to decode lossless JPEG2000 DICOM images, I strongly suggest that you do not use this format for storage. This encoding is not well supported, and the benefits are minimal compared to general file (zip/gz) or disk based compression. Using any rare format is problematic, and in this specific case one of the two popular open-source JPEG-2000 libraries does not handle the 16-bit images seen in medical imaging (https://en.wikipedia.org/wiki/JPEG_2000). This format also blocks you from using the fantastic and free dcmtk tools (http://dicom.offis.de/dcmjp2k.php.en  "This module is not freely available and must be licensed separately"). My personal opinion is that JPEG2000 has little future: it marginal benefit over the older, simpler, wildly popular classic JPEG. On the other hand, the modern HEIF format outperforms JPEG2000 and has seen widespread adoption in software and hardware allowing for little developer/computational cost for a better result (https://en.wikipedia.org/wiki/High_Effic...). While I am not sure if DICOM will adopt HEIF, I think the popularity of HEIF will hinder the development and support of JPEG2000.

      Jun 9, 2017  12:06 PM | Chris Rorden
      RE: Error: OpenJPEG j2k_to_image failed to decode
      Ningfei Li fixed this in the latest release. Please test this out.
       https://github.com/rordenlab/dcm2niix/releases/tag/v1.0.20170609

      Dec 30, 2023  01:12 PM | nora mila
      RE: Error: OpenJPEG j2k_to_image failed to decode


      The error regarding OpenJPEG's failure to decode JPEG2000 images can be resolved with the latest release of dcm2niix available at GitHub link. Another solution for MacOS is using the version of dcm2niix included in MRIcro (found in the Import menu) from NITRC MRIcroGL download.


      Furthermore, I recommend avoiding JPEG2000 format for storage due to limited support, especially for 16-bit medical imaging. For better results, consider alternatives like HEIF format. Explore third party tool like JPEG Compressor for optional image formats and optimization.

      • Dec 31, 2023  05:12 PM | Chris Rorden
        RE: Error: OpenJPEG j2k_to_image failed to decode

        Please ensure a human audits the responses of generative AI when replying to forums. The question here is about DICOM, which does not support HEIF as a transfer syntax. Likewise, the external link you provide does not support DICOM images. You can see comments regarding DICOM JPEG compression here:  https://crnl.readthedocs.io/jpeg_formats...


        I do sincerely appreciate community support, and encourage thoughtful responses to open questions. However, I have to admit that when I first saw this I thought it was a Turing test ( MILA = ML + AI )


         

  • Feb 25, 2019  11:02 PM | Rita Chen
    Volume split when converted from dicom to nii
    I have an MRI study with a single patient and series as dicom images but for some reason when I convert to Nifti with dmc2niix it gets split into 2 volumes. I tried opening it with MRIcroGL to check and it looks like it's been split into the lower and upper half of the head. (this is still just a single .nii file with two volumes, not that it was output as two separate .nii files).

    I'm not sure it's the conversion, but I checked the metadata for the dicom and it should be one single volume. Does anyone know how to keep it as one volume during conversion? Or just simply merge the two volumes together to get one? As it is now, loading it into a program that doesn't allow you to choose which volume to view defaults to the lower half of the head (I assume since it's the first one in the array) but I need the entire head.
    Attachment: volumesplit.png

    • Mar 10, 2019  09:03 PM | Chris Rorden
      RE: Volume split when converted from dicom to nii
      Hello-
      The problem is not with dcm2niix, but your images. One set does not have the transfer syntax set - this is a Type 1 property, so these are not longer valid DICOMs. The second case has been corrupted with variable slice instance UIDs. In both cases, I think you can fix this by working out the providence of these images and getting copies prior to corruption.

      For the second case, dcm2niix clearly warns you:

      slices not stacked: series instance UID varies (duplicates all other properties)

      You could try to salvage your data with this the "-m y":
      dcm2niix -m y -f %t_%s_%p ~/tst/NITRC
      But you will need to make sure that you only process one exam at a time.

      Your DICOMs have been corrupted: each slice from a single 2D series has been assigned a different StudyInstanceUID, e.g.
      (0020,000d) UI [1.3.6.1.4.1.11157.2018.9.10.17.12.50.6714] # 42, 1 StudyInstanceUID
      I suggest you check the providence of your images and see where they were corrupted. While I have never heard of "MultiTech msiCOM", this would be my prime suspect.
      (0002,0013) SH [MultiTech msiCOM] # 16, 1 ImplementationVersionName

      Dec 19, 2023  03:12 AM | Alexey Samsonov - University of Wisconsin
      RE: Volume split when converted from dicom to nii

      Originally posted by Rita Chen:


      I have an MRI study with a single patient and series as dicom images but for some reason when I convert to Nifti with dmc2niix it gets split into 2 volumes. I tried opening it with MRIcroGL to check and it looks like it's been split into the lower and upper half of the head. (this is still just a single .nii file with two volumes, not that it was output as two separate .nii files). I'm not sure it's the conversion, but I checked the metadata for the dicom and it should be one single volume. Does anyone know how to keep it as one volume during conversion? Or just simply merge the two volumes together to get one? As it is now, loading it into a program that doesn't allow you to choose which volume to view defaults to the lower half of the head (I assume since it's the first one in the array) but I need the entire head.

      Hi Rita,


      Did you find a solution to your problem?


      I have the same problem with a 3D acquisition from a GE scanner. I'm sure it is not a problem with DICOMS as those are directly obtained from the scanner, so no chance of corrupting the DICOMs. 

      Thanks,
      Alexey.

      • Dec 19, 2023  01:12 PM | Chris Rorden
        RE: Volume split when converted from dicom to nii

        Alexey,


          Your question is underspecified, but I am going to guess that you acquired data using GE's Zip2 interpolation and converted with an obsolete version of dcm2niix that was not aware of this technique. You should make sure your are using the latest version (v1.0.20230411):


         https://github.com/rordenlab/dcm2niix/releases


        You can see the version as the first line of output each time you run dcm2niix.




        Chris Rorden's dcm2niiX version v1.0.20230411  Clang14.0.3 ARM (64-bit MacOS)




        In general, I would discourage using interpolation at the acquisition stage. I would expect the image will get resliced during spatial normalization. 


         


         

      Dec 20, 2023  09:12 AM | skhans
      RE: Volume split when converted from dicom to nii

      How to get slices of single DICOM file. I have a dataset that contains numerous DICOM files, and each DICOM file contain 30 slices. I want PNG/JPG of each slice that is 30 slices (PNG/JPG) from single DICOM file. How to get it?

  • Sep 29, 2023  05:09 PM | jhs69
    Warning: Slice timing appears corrupted Siemens Skyra

    Hello,


     


    I am trying to convert some old DICOM files to nifti, but have gotten an error warning me that my slice times may be corrupted. Upon investigation, many of the slice timings are greater than my TR. The issue does not appear to be due to incorrect units (eg TR in seconds and slice timings in milliseconds). I have provided the JSON contents below and happy to provide additional information if helpful. Any suggestions on how to approach this issue would be greatly appreciated!

    JSON contents:
    {
      "AcquisitionMatrixPE": 98,
      "AcquisitionNumber": 1,
      "AcquisitionTime": "09:36:53.452500",
      "BandwidthPerPixelPhaseEncode": 14.789,
      "BaseResolution": 98,
      "BodyPartExamined": "BRAIN",
      "CoilCombinationMethod": "Sum of Squares",
      "ConsistencyInfo": "N4_VD13A_LATEST_20120616",
      "ConversionSoftware": "dcm2niix",
      "ConversionSoftwareVersion": "v1.0.20220720",
      "DerivedVendorReportedEchoSpacing": 0.000689978,
      "DeviceSerialNumber": "45306",
      "DwellTime": 2.9e-06,
      "EchoTime": 0.033,
      "EchoTrainLength": 86,
      "EffectiveEchoSpacing": 0.000689978,
      "FlipAngle": 65,
      "HeudiconvVersion": "0.12.2",
      "ImageComments": "SMS_MGH_V2.1; MB=5; FOVshift=4; K_PE=3; K_RO=3; CCR=1; LeakBlockOn;",
      "ImageOrientationPatientDICOM": [1, 0, 0, 0, 1, 0],
      "ImageOrientationText": "Tra",
      "ImageType": [
        "ORIGINAL",
        "PRIMARY",
        "M",
        "ND",
        "MOSAIC"
    ],
      "ImagingFrequency": 123.232,
      "InPlanePhaseEncodingDirectionDICOM": "COL",
      "InstitutionAddress": 
      "InstitutionName": 
      "InstitutionalDepartmentName": 
      "MRAcquisitionType": "2D",
      "MagneticFieldStrength": 3,
      "Manufacturer": "Siemens",
      "ManufacturersModelName": "Skyra",
      "MatrixCoilMode": "SENSE",
      "Modality": "MR",
      "NonlinearGradientCorrection": false,
      "PartialFourier": 0.875,
      "PatientPosition": "HFS",
      "PercentPhaseFOV": 100,
      "PercentSampling": 100,
      "PhaseEncodingDirection": "j-",
      "PhaseEncodingSteps": 86,
      "PhaseResolution": 1,
      "PixelBandwidth": 1760,
      "ProcedureStepDescription": 
      "ProtocolName": "Bold_sms_StressTask_run_1",
      "PulseSequenceDetails": "%CustomerSeq%\\ep2d_bold_sms_mgh_v22",
      "ReceiveCoilActiveElements": "HEA;HEP",
      "ReceiveCoilName": "Head_32",
      "ReconMatrixPE": 98,
      "RepetitionTime": 1.25,
      "SAR": 0.401866,
      "ScanOptions": "PFP\\FS",
      "ScanningSequence": "EP",
      "SequenceName": "epfSM2d1_98",
      "SequenceVariant": "SK",
      "SeriesDescription": "Bold_sms_StressTask_run_1",
      "SeriesNumber": 3,
      "ShimSetting": [1950, 7762, -14938, 328, -99, 573, 520, 81],
      "SliceThickness": 2,
      "SliceTiming": [0, 3.1575, 0.085, 3.24, 0.1675, 3.3225, 0.25, 3.4075, 0.3325, 3.49, 0.415, 3.5725, 0.5, 3.655, 0.5825, 3.7375, 0.665, 3.8225, 0.7475, 3.905, 0.8325, 3.9875, 0.915, 4.07, 0.9975, 4.155, 1.08, 4.2375, 1.1625, 4.32, 1.2475, 4.4025, 1.33, 4.485, 1.4125, 4.57, 1.495, 4.6525, 1.58, 4.735, 1.6625, 4.8175, 1.745, 4.9025, 1.8275, 4.985, 1.9125, 5.0675, 1.995, 5.15, 2.0775, 5.2325, 2.16, 5.3175, 2.2425, 5.4, 2.3275, 5.4825, 2.41, 5.565, 2.4925, 5.65, 2.575, 5.7325, 2.66, 5.815, 2.7425, 5.8975, 2.825, 5.98, 2.9075, 6.065, 2.99, 6.1475, 3.075],
      "SoftwareVersions": "syngo MR D13",
      "SpacingBetweenSlices": 2,
      "StationName": "221L-3T",
      "TaskName": "stress1",
      "TotalReadoutTime": 0.0669278,
      "TxRefAmp": 311.453}

    • Sep 29, 2023  06:09 PM | Chris Rorden
      RE: Warning: Slice timing appears corrupted Siemens Skyra

      See my comments here:


        https://neurostars.org/t/slicetiming-val...


       


      This data was acquired with an early multiband (SMS) research sequence from the MGH. The sequence stored the single-band rather than multi-band slice times in the DICOM CSA header. My software assumes that the DICOM data is useful. I note you are using a version of my software from 2022 (v1.0.20220720). You should try the latest release to see if it can find any DICOM headers with valid timing. If this does not work, you will need to contact the developers of the sequence to find out their SMS slice timing pattern.

      • Oct 2, 2023  04:10 PM | jhs69
        RE: Warning: Slice timing appears corrupted Siemens Skyra

        Thank you for your reply! Unfortuantely I got the same error with the newer release. I will try contacting the developers. Thank you again!

  • Sep 29, 2023  05:09 AM | cz239 - Weill cornell medicine
    Recommendations for Converting Composed Abdomen MR DICOM with Inconsistent Slice Spacing to NIfTI

    Hello Chris and the `dcm2niix` community,


    I'm reaching out for guidance on a challenge we're currently facing. We are working with abdomen MR DICOM images intended for segmentation model training. We've observed that some of our DICOM datasets, which are composed images (resulting from upper and lower acquisition sequences combined together), exhibit inconsistent actual slice spacing. I understand that the NIfTI format typically assumes equidistant slices.


    Having not tried the `dcm2niix` conversion for these particular datasets yet, I'd like to be proactive and gather insights:


    1. Is it possible to convert such DICOM images with varying slice spacings to NIfTI using `dcm2niix` without running into issues?
    2. If challenges are anticipated, do you have any recommendations or best practices for preprocessing these DICOM images prior to conversion?
    3. Are there specific flags or parameters in `dcm2niix` that might help in ensuring an accurate conversion for these datasets?


    Thank you for your time and expertise. We truly appreciate any insights you can provide.


    Chenglin

    • Sep 29, 2023  09:09 PM | Chris Rorden
      RE: Recommendations for Converting Composed Abdomen MR DICOM with Inconsistent Slice Spacing to NIfTI

      It sounds like your scans will be composed of several different series, each with different resolutions and FOVs. dcm2niix converts each DICOM series as a separate NIfTI file. Therefore, you will have one NIfTI image per series. You will then want to use a different tool to concatenate them all together as a single file. The NIfTI format requires that all voxels are equidistant, so some interpolation will need to be required if you have different FOVs or distance between slice centers. The task of stitching different series together is outside the remit of dcm2niix, so you will have to use a different tool.

  • Sep 28, 2023  10:09 AM | Suk Won CHOI
    Warning message converting DICOM to NIFTI files

    Hello,


    I'm encountering issues while trying to convert DICOM files to NII files using dcm2niix(version v1.0.20230411  Clang14.0.0 ARM (64-bit MacOS)), due to some warning messages. I'm processing data from two different centers, and they are showing different warning messages.


    For the first center, which used a MAGNETOM Trio scanner, I'm getting the following warnings for image types of EPI, REST and DTI.


    Warning: Weird CSA 'ProtocolSliceNumber' (System/Miscellaneous/ImageNumbering reversed): VALIDATE SLICETIMING AND BVECS


    Warning: Assuming mosaics saved in reverse order due to 'sSliceArray.ucImageNumb'


     


    For the second center, which used a MAGNETOM Vida scanner, I'm getting the following warning for EPI and DTI data:


    EPI and DTI appear to have


    CSA slice timing based on 2nd volume, 1st volume corrupted (CMRR bug, range 8350..9085, TR=835 ms) / CSA slice timing based on 2nd volume, 1st volume corrupted (CMRR bug, range 44800..47837.5, TR=3200 ms


    Even though these warnings are appearing, the NII files seem to open correctly. I will be using EPI and DTI images, so is it safe to proceed with the analysis as is? If there might be an issue, what kind of processing can be done? I've attached the JSON files as well.


    Thanks in advance.

    • Sep 28, 2023  10:09 AM | Suk Won CHOI
      RE: Warning message converting DICOM to NIFTI files

      additional json files.

      Sep 28, 2023  10:09 AM | Suk Won CHOI
      RE: Warning message converting DICOM to NIFTI files

      additional json files! Thanks.

      Sep 28, 2023  11:09 AM | Chris Rorden
      RE: Warning message converting DICOM to NIFTI files

      Hello,


       Both of these are warnings not edge cases, where you as the user must ensure everything is correct. These reflect datasets where I have had little exposure and where it is possible that the solution is not robust


      The weird protocol slice number reflects a sequence that was run with with H>>F. Presumably, the person who set up the sequence assumed that this would create descending acquisitions, but this is not the case. As Siemens notes: "Do not use the mode H>>F because this complicates the numbering and you will have to sort images manually in most fMRI post-processing tools. The excitation of the slices in this case also starts caudally with the highest image numbers counting backwards!" I would strongly suggest users follow Siemens recommendations, and I obviously have few exemplars where users explicitly disregard the manufacturer expectations.


      https://marketing.webassets.siemens-healthineers.com/1800000001646277/f90d901c54b7/Flash60_HIDI_Slicetiming_Graessner_final2_KORR.pdf


      Some Siemens Vida's had early versions of Siemens XA, which did not provide accurate slice timing in all situations. This is fixed by upgrading the scanner (I believe XA20 and later are robust). Regardless, when you see this warning you will want to inspect the slice timing values to make sure they are correct.


       

      • Sep 28, 2023  12:09 PM | Suk Won CHOI
        RE: Warning message converting DICOM to NIFTI files

        It's not clear which sequence you're referring to, but I did get an image with F >> H. I'm attaching the relevant protocol. If this still happens, can I just use the data for analysis? 


        If not, I was wondering if there is a way to fix it in post-processing. 
        Thanks for your quick response.

        • Sep 28, 2023  12:09 PM | Chris Rorden
          RE: Warning message converting DICOM to NIFTI files

          The foot head issue seems to reflect the setting of the Trio data. I have very little experience with these images. For existing images, you should make sure the spatial orientation, slice timing and gradient vector direction are correct. For future acquisitions, make sure that the default image numbering is used. If you have any questions you should seek the help of the Siemens Research Collaboration Manager associated with the site where the data was acquired. I have done my best to robustly handle data from a wide array of devices, but my software will generate warnings in situations where I have do not have enough experience to provide confident conversions.  

  • Sep 7, 2023  08:09 PM | María Torres
    Wrong output using dcm2niix with DWI images

    Hi experts, 


    Hello experts,


    I'm struggling with converting diffusion images from DICOM to NII format for data obtained from a Philips Intera MRI. The issue is that my bvec files are mostly zeros.


    I get the following warnings: 


    Warning: Volume number does not vary (0019,10A2; 0020,0100; 2005,1063; 2005,1413), assuming meaningful instance number (0020,0013).
    Error: Check sorted order: 4D dataset has 34 volumes, but volume index ranges from 33..3960
    Warning: Isotropic DWI series, all bvecs are zero (issue 405)
    Warning: Volume 1 appears to be derived image ADC/Isotropic (non-zero b-value with zero vector length)


    ......


    Warning: Saving 34 DTI gradients. Validate vectors (image slice orientation not reported, e.g. 2001,100B)


    Any tips or guidance on this matter would be greatly appreciated.


    Thanks in advance,


    María José Torres


     

    • Sep 7, 2023  08:09 PM | Chris Rorden
      RE: Wrong output using dcm2niix with DWI images

      1. I would ensure you are using the latest stable release of dcm2niix  v1.0.20230411 https://github.com/rordenlab/dcm2niix/re...
      2. You can find validation datasets for Philips DICOM images here:
        https://github.com/neurolabusc/dcm_qa_philips
      3. The warnings suggest some slices may be missing. I would try to export the DICOMs direct from your scanner before it has been touched by any PACS or anonymization tool to see if they are corrupting your data.
      4. I suggest you contact the Philips Clinical Scientist associated with your scanner. They can help guide you.

  • Aug 25, 2023  04:08 PM | Chrissy boss
    dcm2niiX output has wrong dimensionality

    Hi there. 


    I am transforming dicom to nifti. I get following output: 


    data_type INT16


    dim1 256


    dim2 256


    dim3 186


    dim4 1


    datatype 4


    pixdim1 1.000000


    pixdim2 1.000000


    pixdim3 1.000000


    pixdim4 0.008136


    cal_max 0.000000


    cal_min 0.000000


    file_type NIFTI-1+; 


    but I need this dimensionality:


    data_type INT16


    dim1 64


    dim2 64


    dim3 30


    dim4 196


    datatype 4


    pixdim1 3.437500


    pixdim2 3.437500


    pixdim3 5.000000


    pixdim4 2.000000


    cal_max 9897.000000


    cal_min 0.000000


    file_type NIFTI-1+


     


    Can someone help me please? Thanks

    • Aug 25, 2023  05:08 PM | Chris Rorden
      RE: dcm2niiX output has wrong dimensionality

      Your question is underspecified. What tool reports the wrong dimensionality? What were the dimensions of the input DICOM? Are you running the current version of dcm2niix (v1.0.20230411) and if not does upgrading resolve your issue. Maybe you can provide the complete output of running `fslhd mynifti.nii` which would provide additional details.

  • Aug 18, 2023  02:08 AM | Manuela Zimmer
    sliceDir in GE DTI scans

    Hello everyone,


    I am currently in the process of validating GE DTI scans using different Patient Positions (HFS, FFS), oblique vs. non-oblique acquisitions and reversed slice orders. When checking the 'geCorrectBvecs()' function I came across the 'sliceDir' variable. I found the function 'headerDcm2NiiSForm()' that is returning sliceDir as follows: 0=unknown,1=sag,2=coro,3=axial,-=reversed slices


    I struggle in understanding what exactly is happening in the C code and how the sliceDir is determined from the DICOM header information. Could anyone help me out, in particular for the settings used by GE?


    The scans that I have are in PhaseEncoding 'COL' either HFS or FFS and slice order either from inferior to superior or from superior to inferior (by ticking the "reverse slice order" check box on the scanner GUI when setting up the FOV).


    Assuming sliceDir to be axial (sliceDir=3), I would expect a bvec file with reversed z component for those scans using the reversed slice order from the 'geCorrectBvecs()' function. (Please be aware that FFS is currently not handled by geCorrectBvecs() but Jaemin Shin from GE recently made changes in the dcm2niix development branch that I am testing).


    I hope my questions are understandable... I appreciate any help or thoughts on this. Thanks!

    • Aug 18, 2023  10:08 AM | Chris Rorden
      RE: sliceDir in GE DTI scans

      The recent PR for the development branch of dcm2niix should resolve this


        https://github.com/rordenlab/dcm2niix/pu...


      To compile the development branch on a Unix computer you can run:


       


      git clone --branch development https://github.com/rordenlab/dcm2niix.gi...
      cd dcm2niix/console
      make
      ./dcm2niix



      If you have additional issues, please create an issue on Github.


      For details on the diffusion tensor details, please see:


      https://github.com/rordenlab/dcm2niix/tree/master/GE#diffusion-tensor-notes


       

      • Aug 20, 2023  10:08 PM | Manuela Zimmer
        RE: sliceDir in GE DTI scans

        Thanks for the fast reply.


        The latest PR you mentioned now considers bvec corrections for non-HFS scans (which is helpful for us and we are currently testing) but there are no changes regaring the sliceDir. And the GE diffusion tensor notes do not provide information about the slice order either. 


        I was hoping to get some insights in how dcm2niix determined the sliceDir variable (i.e. which DICOM headers are considered to determine if the slice direction was axial, coronal, sagittal and if it was reversed.)

        • Aug 21, 2023  05:08 PM | Chris Rorden
          RE: sliceDir in GE DTI scans

          The DICOM tag ImageOrientationPatient (0020,0037) reports the row and column vectors. The cross product provides the slice direction for MR (with CT you need to be aware of gantry tilt).


            https://dicom.innolitics.com/ciods/rt-do...


          The DTI bvec is in image space. The world space orientation information is recorded in the SForm and QForm.


           


          https://brainder.org/2012/09/23/the-nifti-file-format/


           


           

          • Aug 21, 2023  09:08 PM | Manuela Zimmer
            RE: sliceDir in GE DTI scans

            I understand that this is straightforward for purely axial, sagittal or coronal acquisition, i.e. (0020,0037) being either [1, 0, 0; 0, 1, 0], [0, 1, 0; 0, 0, 1] or [0, 1, 0; 0, 0, 1]. But how about oblique acquisitions? Are there threshold values about how much the image coordinate system can be rotated to still be considered e.g. "axial" acuqisition?


            (0020,0037) describes the image-to-world-coordinate transformation and also which axis (the z axis) is the slice encoding direction. The remaining (x and y) describe Freq and Phase Encoding ((0018,1312) InPlanePhaseEncodingDirection can be set to either COL or ROW to determine if (x,y) are (Freq, Phase) or (y,x) are (Freq, Phase)). But the (0020,0037) does not describe the polarity of the Freq, Phase and Slice Encoding directions. Correct? As GE uses the "MR physics coordinate system" to define their diffusion gradients, I am trying to understand if this needs to be reflected in the "sliceDir" variable that is used by the "GEcorrectBvecs" function. 

  • Jul 12, 2023  07:07 PM | jblujus
    Phase Encoding Direction Polarity

    Hello,


    I have used dcm2niix (v1.0.20210317) to convert ADNI DWI data collected on Siemens, GE, and Philips scanners to NIFTI format. I am trying to determine the phase encoding direction of each scan to use the eddy tool for distortion correction. 


    I am aware from a post on neurostars that only the phase encoding axis can be estimated for Philips (i,j,k) but not the polarity due to missing information from meta-data (https://neurostars.org/t/bids-fmriprep-s...). So it seems, I will have to get that information from ADNI, rather than the JSON files.


    For the Siemens and GE files, a majority of phase encoding directions are "j", but some are noted as "j-" in the JSON files. Given that this is an axial acquisition, "j" should map onto the y-axis (PA). I then used fslhd to confirm this by extracting the sform_code and sform_yorient information. For all subjects (regardless of whether PhaseEncodingDirection was coded as j or j-), the sform_yorient is Posterior-to-Anterior. 


    For subjects with reverse polarity ("j-"), should the sform_yorient instead be coded as Anterior-to-Posterior? Ultimately, I'm wondering if there is any information from fslhd that should code the change in acquisition polarity (e.g., "j-" swapped PE direction)?


     


    Thank you,


    Jenna

    • Jul 12, 2023  08:07 PM | Chris Rorden
      RE: Phase Encoding Direction Polarity

      The sform_yorient informs you that the row order of the image data as stored on disk is Posterior-to-Anterior: it tells you how to map voxels to world space. In contrast, the polarity tells you the direction of the phase encoding. One expects the data to be stored with the same spatial frome of reference, regardless of the order rows are acquired.

      • Jul 12, 2023  09:07 PM | jblujus
        RE: Phase Encoding Direction Polarity

        Hi Chris,


        Thank you for your response. Just to be clear that I'm interpreting your response correctly, would the following two conditions be true:


        *A subject with axial acquisition and a "PhaseEncodingDirection: j" should have a sform_yorient="Poster-to-Anterior"


        *A subject with axial acquisition and a "PhaseEncodingDirection: j-" should similarly have a sform_yorient "Posterior-to-Anterior".


        If so, this indicates that sform_yorient provides information about the acquisition plane and will change based on polarity.


        Thank you,


        Jenna


         


        Originally posted by Chris Rorden:



        The sform_yorient informs you that the row order of the image data as stored on disk is Posterior-to-Anterior: it tells you how to map voxels to world space. In contrast, the polarity tells you the direction of the phase encoding. One expects the data to be stored with the same spatial frome of reference, regardless of the order rows are acquired.



         

        • Jul 12, 2023  10:07 PM | Chris Rorden
          RE: Phase Encoding Direction Polarity

          Think of the sform_*orients like a compass drawn on a map, which shows you how to orient the map so you know which direction is North, South, East and West. In contrast, think of the PhaseEncoding Direction as telling you if the farmer ploughed his field from north-to-south,  south-to-north, east-to-west or west to east. 

          • Jul 13, 2023  02:07 PM | jblujus
            RE: Phase Encoding Direction Polarity

            Thank you for the explanation. So the sform*orient will provide information on how to map the i, j, k indices in the BIDS JSON to world space. 


            sform_code      1
            sto_xyz:1       -1.367200 -0.000000 0.000000 180.621002 
            sto_xyz:2       0.000000 1.367200 0.000000 -152.802017 
            sto_xyz:3       0.000000 0.000000 2.700005 -65.000862 
            sto_xyz:4       0.000000 0.000000 0.000000 1.000000 
            sform_xorient   Right-to-Left
            sform_yorient   Posterior-to-Anterior
            sform_zorient   Inferior-to-Superior


            For example, the above information tells us that i maps to RL, j maps to PA, and k maps to IS. 


             


            The PhaseEncodingDirection JSON tag then tells us how the data were collected. So, 'j' will indicate PA acquisition, while 'j-' will indicate AP acquisition, correct?


             


            Thank you for your patience. I want to make sure I'm interpreting this information correctly. 


            Jenna

            • Jul 13, 2023  07:07 PM | Chris Rorden
              RE: Phase Encoding Direction Polarity

              sform_xorient converts columns to world space


              sform_yorient converts rows to world space


              sform_zorient converts slices to world space


              The PhaseEncodingDirection i/i- reveals phase encoding in ascending/descending columns.


              The PhaseEncodingDirection j/j- reveals phase encoding in ascending/descending rows.


               


               


               


               

  • May 16, 2023  09:05 AM | patrick_nm
    Latest dcm2niix version
    Hi,
    I am trying to install the latest dcm2niix version (v1.0.20230411). I have tried several ways, such as using "sudo apt-get install dcm2niix" or by downloading the zip file from github.com/rordenlab/dcm2niix/releases, but when I check the dcm2niix version with "dcm2niix -u" it tells me that I have dcm2niix version v1.0.20181125 (JP2:OpenJPEG) GCC9.3.0 (64-bit Linux) and that there is a newer version available.
    What am I doing wrong?

    Thanks and best regards!

  • Apr 19, 2023  01:04 PM | Manuela Zimmer
    GE diffusion data FFS and in spatially descending order
    Hi everyone,

    I have diffusion MRI data from a GE Signa Premier that was acquired FFS (feet first supine) and in spatially descending order (head-to-foot) with Phase Encoding direction (0018,1312) "COL".
    It is a scan of the lower leg which I want to use for skeletal muscle modelling purposes.
    When using dcm2niix (v1.0.20220720), I obtain the following two messages/warnings:
    • Warning: Unable to compute slice times for GE Diffusion
    • GE DTI directions require head first supine acquisition
    I checked the readme on the Github page in more detail and followed some links with useful information about GE.
    Here (https://www.na-mic.org/wiki/NAMIC_Wiki:D...), I found the following hint:

    "The gradient directions are in the image (rather than scanner bore) frame of reference. The interpretation depends on the Phase Encoding direction (0018,1312). If 0018,1312 is "COL" than 0019,10bb refers to the image columns (i), 0019,10bc refers to the image rows (j) and 0019,10bd refers to the slices (k). If 0018,1312 is "ROW" [...].
    There are two caveats: This assumes that your slices are stacked in spatially ascending order (head to foot for axial acquisitions) regardless of the order that they were saved to disk (which appears to vary depending on how the user plans the scan). You need to adjust the polarity of these directions to match the expectations of the software used for fitting."

    How do I need to adjust the polarity of the gradient directions?
    Do I need to modify the DICOM images before converting to nifti because they are FFS instead of HFS?

    There is no error for dm2nixx. Therefore, the nifti file, bvec and bval files are generated.
    The nifti file looks correct (viewing the 4D matrix with fsleyes) and the matrix size is as expected (256x256x60x32).
    However, when calculating the eigenvectors (and later performing the tractography), we can observe anatomical unexpected (incorrect) directions.

    Any help is appreciated. Thanks!

    • Apr 19, 2023  02:04 PM | Chris Rorden
      RE: GE diffusion data FFS and in spatially descending order
      We do not have GE hardware at my site. FFS generates an error as it has never been validated. You could try reversing the polarity of the 3rd component of the bvec file to see if that resolves your issue. You will want to carefully validate using the method described here
         https://www.nitrc.org/docman/?group_id=880

  • Apr 9, 2023  12:04 PM | Antonio Innocenzi
    Problems converting DICOM in NiFTI with data from a 3T GE 750
    Hi everybody, I'm an italian radiology resident. I'm trying converting a DWI DICOM file folder in NiFTI, in order to obtain a .mat file, usable on Explore DTI or FSL. 
    I've tried multiple tools as explore DTI plugin or MrICRO. Using the last one i obtain these problems:
    "DICOM images may be missing, expected 50 spatial locations per volume, but found 25.
    Warning: Unable to determine GE Slice timing, no Protocol Data Block GE (0025,101B): C:\Users\HP\Desktop\Sequenze prova\DWI 2 prova - Copia\dwi\UD02XKTM\CV0UEYHL\I1000000
    Note: B0 not the first volume in the series (FSL eddy reference volume is 1)
    Warning: Some images had bval>0 but bvec=0 (either Trace or b=0, see issue 245)
    Note: this appears to be a b=0+trace DWI; ADC/trace removal has been disabled.
    Maximizing 16-bit range: raw 0..5025 is6".

    I can use a 3T MRI GE750. Can someone help me understanding the reasons of these problems and, eventually, possible solutions?

    Best regards,

    Antonio

    • Apr 9, 2023  01:04 PM | Chris Rorden
      RE: Problems converting DICOM in NiFTI with data from a 3T GE 750
      Your questions is underspecified to provide a diagnosis. Details like the version of dcm2niix you are using would help, as well as the full details to replicate. I would suggest you file an `issue` for dcm2niix:
        https://github.com/rordenlab/dcm2niix
      the template will guide you through the details that help providing feedback.

      My first guess is that an anonymization tool has stripped out the DICOM tags that are vital for determining sequence details:
         https://github.com/rordenlab/dcm2niix/tree/master/GE

      I suggest you check the provenance of your images. Specifically, a direct export from the scanner should include the private tag 0025,101B.

  • Apr 5, 2023  05:04 PM | Xicheng Sheng
    Automatic stacking for 4D images from UIH
    Dear all,

    First of all thanks for your tool and the great support you are giving here!

    Please excuse my rather basic question:

    I am trying to convert some UIH CMRs in dicom to Nifti, using dcm2niix. For a typical folder, there are a total of 225 dcms from time series of 9 slices (00000001.dcm to 00000025.dcm from slice 1, 00000026.dcm to 00000050.dcm from slice 2, and so on). I check that the position tag(0020,0032) is correct, but I cannot get the desired result no matter how -m is set.

    The shape of the output file is 336*336*9*25 as expected, but the last two dimensions(slice and time) mix up. Specifically, it seems that time series for the first slice make up [x,y,:,0:2] and [x, y, 0:7, 2] (2*9+7 =25), while ideally it should be [x, y, 0, : ].

    Also, here are the info and warnings I got during the conversion:
    - DICOM images may be missing, expected 225 spatial locations per volume, but found 9.
    - Images sorted by instance number [0020, 0013](1...225), but AcquisitionTime[0008, 0032] suggests a different order(220410.220032)
    - Siemens MoCo? Bogus slice timing(range -1,...-1,TR= 2.292 seconds)
    - Unable to determine slice direction: please check whether slices are flipped

    I wonder whether I can get the correct 4D nifiti file (x,y,z,t) directly from dcmniix. 

    Thanks in advance.

    All the best,
    Helen

    • Apr 5, 2023  08:04 PM | Chris Rorden
      RE: Automatic stacking for 4D images from UIH
      I have very little experience with UIH data, and have never seen fMRI from this manufacturer:

      1. Are you using the latest release (v1.0.20220720)?

      2. Does the development branch fix your issue? You can get this by selecting your Operating system (win/linux/mac)and downloading the artifact
        https://ci.appveyor.com/project/neurolabusc/dcm2niix


      3. If these fail, can you send a sample dataset to my institutional email?
      https://sc.edu/study/colleges_schools/ar...

      Apr 6, 2023  03:04 AM | Xicheng Sheng
      RE: Automatic stacking for 4D images from UIH
      Dear Chris,

      Thanks for your prompt reply.

      I am with the latest release on MacOS, and the development branch fails either. Unfortunately, I could not share the data for now.

      The same problem occurs in a similar dataset CINE_segmented_SAX_InlineVF from Siemens Prisma. I wonder if volumes(z-axis) are stacked first by default, while time series for a slice comes together in my data. Is there any way to force the stacking order with dcm2niix?

      Thanks for the help!

      Best regards,
      Helen

      • Apr 6, 2023  10:04 AM | Chris Rorden
        RE: Automatic stacking for 4D images from UIH
        I can not replicate your issue with UIH data
          https://github.com/neurolabusc/dcm_qa_uih
        likewise, dcm2niix handles many Siemens datasets as seen in various dcm_qa_* validation datasets as well as usage by many teams. As I can not replicate this issue, I can not provide any insight. However, I do wonder if this issue is not with your raw data, but with corruption caused by a PACS that touched the data or some anonymization tool. I would check the provenance of your data and see if the same issue exists for data exported directly off the scanner without being touched by another tool. If the problem still persists, I suggest working with the Siemens Research Collaboration Managar associated with your center (and the equivalent UIH employee).

        • Apr 6, 2023  11:04 AM | Xicheng Sheng
          RE: Automatic stacking for 4D images from UIH
          Dear Chris,

          Thanks for the help and advice.

          I would check with our collaborators, and might update you later when we figured it out.

          For emergency use, we now simply reorder the array and the headers seem okay.

          Thanks again for the tool and help!

          Best,
          Helen

  • Apr 3, 2023  03:04 PM | Paul Wright - King's College London
    Non tilt-corrected image stretched A-P
    Hi

    I have tried to reproduce Chris' results here. When I compare the images with and without tilt correction using SPM Check Reg, the shear appears to be correctly applied to both, but the uncorrected one looks longer anterior to posterior. The screenshot is from the open CQ500 dataset, but my concern is with my local hospital data, which has a similar effect.

    Image

    I would like to know if there's a fix for this, either to apply to the NIfTI header, or to fix something that is wrong with the DICOM metadata. I have no idea if the issue is with my version of SPM (SPM12 r7771, which may be different to what Chris used in Dec 2018) or something to do with my image metadata.

    I can change the voxel scaling in SPM to get the images looking more similar, but not knowing my matrix maths as well as Chris, I would not want to apply this without expert reassurance.

    Here's as much info as I can think to include from an example from my local hospital set.

    Manufacturer / Model: GE Optima CT660.
    DICOM geometry: 512 x 512 x 256 matrix with 0.449219 x 0.449219 x 0.625 mm voxels.
    DICOM gantry tilt (0018,1120): 20.5 (dcm2niix estimates the same value from slice vector).

    Results of spm_get_space (I tried to use code tags to line up the numbers but it looks like the main page doesn't render them, despite the editor doing so):
    Uncorrected
    -0.4492      0       0  115.4492
          0 0.4796  0.0000 -110.6766
          0 0.1573  0.5852  -89.0279
          0      0       0    1.0000
    Corrected
    -0.4492      0       0  115.4492
          0 0.4208 -0.2188 -110.3990
          0 0.1573  0.5852  -89.0279
          0      0       0    1.0000

    Results from spm_imatrix:
                 Translation                   Rotation      Scaling                 Affine
    Uncorrected: 115.4492 -110.6766 -89.0279   -0.3170 0 0   -0.4492 0.5047 0.5560   0 0 0.3614
    Corrected:   115.4492 -110.3990 -89.0279   -0.3578 0 0   -0.4492 0.4492 0.6248   0 0 0.0000


    Geometry from Check Reg:
                Uncorrected           Corrected
    Dimensions  512x512x256           512x645x256
    Rotations   1 0 0                 1 0 0
                0 0.95 -0.31          0 0.94 -0.35
                0 0.31 0.95           0 0.35 0.94
    Origin      257, 230.77, 90.09    257, 299.6, 71.59
    Voxel size  -0.45, 0.50, 0.56     -0.45 0.45 0.62

    Opening in SPM Display gives similar voxel size, orientation, and direction cosine, and says "Warning shears involved" for the uncorrected but not the corrected, which I'd expect.

    Each volume that I checked has 8 acquisition numbers, each with 32 slices, which I guess are acquired with a pause between them as you can sometimes see slight discontinuities in the image about 32 slices apart when the patient moves. So maybe this acquisition protocol leads to the unexpected results (it is the same for CQ500 data).

    Other than that, I couldn't see the effect in another volume with a smaller gantry tilt (e.g. 4 degrees) but that might be just because it was harder to see.

    I'm happy to go digging for more info in the DICOM metadata or SPM if requested, and appreciate any help you can offer. 

    Best wishes
    Paul Wright
    King's College London
    Attachment: tilt_example.png

    • Apr 5, 2023  01:04 PM | Chris Rorden
      RE: Non tilt-corrected image stretched A-P
      Well spotted. I have created a github issue to describe this behavior and my solution:
        https://github.com/rordenlab/dcm2niix/is...
      Please test my solution, it simply negates the shear. I suspect there are more complex but generalized matrix multiplication solutions, but they are somewhat complicated by anisotropic voxels. For this reason, I hope my simple solution proves robust. Coming from MR, I have very little exposure to CT exemplars, so please validate my solution.

  • Mar 28, 2023  02:03 PM | mrschipper
    dcm2niix to create 4D data based on single slice DICOMs
    Dear expert,

    DICOMs of our 4D functional MRI scans are mostly stored as single slice DICOM files. When using these single slice DICOM files as input for dcm2niix, I get NIFTIs of each dynamic seperately. However, for processing purposes, I would like to get a 4D NIFTI with all dynamics. Adding option -m seems to do the trick:
    dcm2niix -o outputfolder -m y inputfolder 
    However, I'm wondering if this is the best approach, since this function seems to force a merge and the merge is meant for 2D slices (and not necessarily 3D data; based on the description of the -m option) 

    Kind regards and thank you in advance for the assistance,
    Manon

    • Mar 28, 2023  02:03 PM | Chris Rorden
      RE: dcm2niix to create 4D data based on single slice DICOMs
      This question is underspecified. It soulds like you have enhanced DICOM data, which suggests you have a Canon, Philips or Siemens XA scanner - so the question is which one? My first guess is this is a system running the emergent Siemens XA, and you will need to get the development build of dcm2niix to support the new features. You can get it by going here
        https://ci.appveyor.com/project/neurolabusc/dcm2niix
      selecting your operating system (windows, Linux or MacOS) and downloading the artifact. This new development version will being report v1.0.20230320


      Alternatively, you can run fslmerge.

  • Nov 30, 2022  04:11 AM | Ben Moloney
    help with conversion of Siemens Vida Fit 3T data
    I am having a problem when converting dicom to nii. I have very new to this and have little training to understand the problem.
    Dicom data is exported from our 3T Vida-Fit scanner in Enhanced dicom format.

    When converting my diffusion MRI data I get the following:

    "Slice timing appears corrputed (range 0..7947.5 TR=8.6ms)"

    What does this mean? Is it bad?

    Some diffusion files also do not have bvec or bval outputs . is that related?

    Let me know if I must provide more information to help you assess :)

    • Nov 30, 2022  11:11 AM | Chris Rorden
      RE: help with conversion of Siemens Vida Fit 3T data
      I suggest you review previous Github issues
        https://github.com/rordenlab/dcm2niix/issues
      for example
        https://github.com/rordenlab/dcm2niix/issues/429
      if these do not resolve your issue, create a new Github issue - the new issue template guides you through details that will improve troubleshooting. With Siemens enahnced DICOMs it is critical to know your software (XA10 was buggy and underspecified, while XA30 is much more complete) as well as the mode that data was exported as described here
        https://github.com/rordenlab/dcm2niix/issues/236
      These reflect limitations in the files created by Siemens, though recent releases of dcm2niix includes kludges to mitigate these.

      Jan 16, 2023  11:01 PM | Ben Moloney
      RE: help with conversion of Siemens Vida Fit 3T data
      Hi Chris,

      I have just returned from a break - thanks for your response and your help on the github issue for out vida fit scanner running XA50 softare.
      You were correct the lack of bvec/bvals was due to the images being derived images.
      I had a look at my ehanced dicom files using "dicombrowser' and info e.g. DOB, name, ID were present, which would indicate to me that these files weren't anonymised when exported?? (correct me if I am wrong)
      But I am continuing to recieve the "Slice timing appears corrupted (Range 0.. 10565 TR-3700ms)" error.
      Please let me know your thoughts

      Best wishes,
      Ben

      • Jan 17, 2023  01:01 PM | Chris Rorden
        RE: help with conversion of Siemens Vida Fit 3T data
        I think you mean "XA30" as that is the latest stable release. Siemens changed their DICOMs radically, with XA10, with more modifications with XA20 and XA30. You may want to try the development branch and see if this fixes your issue

        You can get the latest compiled version of the development branch from appveyor:
          https://ci.appveyor.com/project/neurolab...
        click on your operating system (win, lune, mac) and then choose 'Artifacts' for a compiled version.

        If you have a Mac or Linux computer, you can build it yourself:

        git clone --branch development https://github.com/rordenlab/dcm2niix.gi...
        cd dcm2niix/console
        make

        You will want to be vigilant with XA30 - it introduces new features and we are rushing to catch up. You will want to heed the warning from dcm2niix to export as enhanced rather than classic DICOMs to get the full meta data. 

        The SNUG Discuss - (Siemens Neuro User Group) is an excellent resource to hear about the opportunities and challenges associated with XA30.

      Jan 17, 2023  11:01 PM | Chris Rorden
      RE: help with conversion of Siemens Vida Fit 3T data
      I stand corrected, the is a XA50 (and XA51).
        https://github.com/CMRR-C2P/MB/discussions/288
      I just do not understand Siemens marketing names.

  • Jan 10, 2023  08:01 PM | aoooooooo
    No error shooting and No result
    Dear Doc,

    I successfully run the dic to Nifti once before with the same PC from IMA files to uncompressed Nifti. However, when I try to do it again with same files but compressed to nii.gz, the dcm2nii gave no result at all and also not error raised. I tried to delete and redownload, restart the pc. None of them worked. If you have any idea of what's wrong about my doing or suggestions to fix it please tell me.

    Best wishes,

    • Jan 10, 2023  08:01 PM | Chris Rorden
      RE: No error shooting and No result
      1. Can you report the full output of running dcm2niix

      2. The complete output reports the version in the first line of output:
        Chris Rorden's dcm2niiX version v1.0.20220720 Clang12.0.5 ARM (64-bit MacOS)
      If you are using a version prior to v1.0.20220720, does upgrading resolve your issue?
        https://github.com/rordenlab/dcm2niix/releases/tag/v1.0.20220720

      You can get the latest stable version from NITRC or Github
        https://github.com/rordenlab/dcm2niix/releases

      • Jan 11, 2023  01:01 PM | aoooooooo
        RE: No error shooting and No result
        Originally posted by Chris Rorden:
        1. Can you report the full output of running dcm2niix

        2. The complete output reports the version in the first line of output:
          Chris Rorden's dcm2niiX version v1.0.20220720 Clang12.0.5 ARM (64-bit MacOS)
        If you are using a version prior to v1.0.20220720, does upgrading resolve your issue?
          https://github.com/rordenlab/dcm2niix/releases/tag/v1.0.20220720

        You can get the latest stable version from NITRC or Github
          https://github.com/rordenlab/dcm2niix/releases
        Thank you for your fast reply, here is the out: F:\2023\BrainTools\MRIcron\Resources\dcm2niix.exe -f "%f_%p_%t_%s" -p y -z y "F:\2023\1.project\tic rating\fMRI\E01Pre"
        Compression will be faster with pigz.exe in the same folder as the executable
        Chris Rorden's dcm2niiX version v1.0.20190902 (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900 (64-bit Windows)

        • Jan 11, 2023  03:01 PM | Chris Rorden
          RE: No error shooting and No result
          1. If you are using a version prior to v1.0.20220720, does upgrading resolve your issue?
          https://github.com/rordenlab/dcm2niix/re...

          2. Does removing spaces in the file path change the behavior?

          3. Is that really the complete text output, usually there is a warning if no files were found?

          dcm2niix c:\empty
          Chris Rorden's dcm2niiX version v1.0.20220720 Clang12.0.5 ARM (64-bit MacOS)
          Error: Unable to find any DICOM images in c:\empty (or subfolders 5 deep)

          • Jan 11, 2023  03:01 PM | aoooooooo
            RE: No error shooting and No result
            Hi Chris,

            Yes, I just re-confirmed that I'm using the new downloaded latest version.

            Removing the space does not help, I once succedd tramsformed my IMA files to nii, but this time when I do the exactly same thing for nii.gz, it's not responding, the only reaction is: after several seconds pause, it shows:

            F:\2023\BrainTools\MRIcron\Resources\dcm2niix.exe -f "%f_%p_%t_%s" -p y -z y "F:\2023\1.Project\tic_rating\fMRI\E01Pre"
            Compression will be faster with pigz.exe in the same folder as the executable
            Chris Rorden's dcm2niiX version v1.0.20220720 (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900 (64-bit Windows)

            on the right side of GUI screen.

            And this time I changed tic rating to tic_rating, there is still nothing converted.

            Best wishes,

            Ao

            • Jan 11, 2023  03:01 PM | Chris Rorden
              RE: No error shooting and No result
              1. Instead of using the graphical interface, run the command directly from the terminal. 
              2. Try running from the terminal without extra options, from the folder with the executable:
                dcm2niix c:\path\to\DICOMs
              3. Since you are not using the output folder option (`-o c:\path\to\NIfTI`) you need to make sure you have read write permission to the folder with the DICOMs, e.g. the F drive can not be a CD-ROM drive.
              4. While I am happy my legacy tools have proved popular and are mature, I have a heavy teaching service and research burden. I do not actively maintain MRIcron, and have put my efforts into MRIcroGL (and am moving to NiiVue). Therefore, I would recommend you try out MRIcroGL which is designed to leverage modern hardware and operating systems.
                https://github.com/rordenlab/MRIcroGL/releases

              • Jan 12, 2023  02:01 PM | aoooooooo
                RE: No error shooting and No result
                Thank you for your patience,

                I used the terminal, and finally find the error: 
                Error: Unable to find any DICOM images in F:\Study\1.2023\tic_rating\fMRI\E01Pre (or subfolders 5 deep).

                The files were in IMA format, not DICOM, is there any way I can do this?

                Best wishes,

                Ao

                • Jan 12, 2023  03:01 PM | Chris Rorden
                  RE: No error shooting and No result
                  Feel free to share datasets with my institutional email for further feedback
                    https://sc.edu/study/colleges_schools/artsandsciences/psychology/our_people/directory/rorden_chris.php
                  However, dcm2niix is designed to handle the very complex DICOM format, not other formats. While Some modern Siemens scanners use the file extension '.ima' for DICOM fragments (e.g. DICOM meta data without the Part 10 DICOM preamble), the .ima extension was also used for proprietary formats that pre-date the DICOM format
                    https://www.dclunie.com/medical-image-faq/html/part4.html
                  You may want to look at the provenance of your images, and see if you can export them as archival quality DICOM data.

  • Jan 3, 2023  12:01 PM | Doug N
    Extract date of scan from converted nifti files
    Hello, 

    I often receive a lot of clinical scans collected on different date on a single CD. Usually only one of these scans will be used for analysis. 

    dcm2niix works very well at converting all of files on a CD into .nii and .json metadata. However, I cannot find the date of the scans anywhere in either the nifti or json files, even though the dates are in the raw DICOM images. 

    Is it possible to extract the date of the scan from the nifti, or to quickly locate the DICOM images used in creating a particular nifti?

    Thanks, 
    Doug

    • Jan 3, 2023  02:01 PM | Chris Rorden
      RE: Extract date of scan from converted nifti files
      By default, dcm2niix will generate anonymized BIDS files. You can use `-ba n` to include private information into the BIDS JSON (e.g. "dcm2niix -ba n /path/to/DICOMs"). Another option would be to encode the date/time into the filename (e.g. "dcm2niix -f %p_%s_%t /path/to/DICOMS").

       
      $ dcm2niix
      Chris Rorden's dcm2niiX version v1.0.20220720 Clang12.0.5 ARM (64-bit MacOS)
      usage: dcm2niix [options]
      Options :
      -1..-9 : gz compression level (1=fastest..9=smallest, default 6)
      -a : adjacent DICOMs (images from same series always in same folder) for faster conversion (n/y, default n)
      -b : BIDS sidecar (y/n/o [o=only: no NIfTI], default y)
      -ba : anonymize BIDS (y/n, default y)
      -c : comment stored in NIfTI aux_file (provide up to 24 characters e.g. '-c first_visit')
      -d : directory search depth. Convert DICOMs in sub-folders of in_folder? (0..9, default 5)
      -e : export as NRRD (y) or MGH (o) instead of NIfTI (y/n/o/j/b, default n)
      -f : filename (%a=antenna (coil) name, %b=basename, %c=comments, %d=description, %e=echo number, %f=folder name, %g=accession number, %i=ID of patient, %j=seriesInstanceUID, %k=studyInstanceUID, %m=manufacturer, %n=name of patient, %o=mediaObjectInstanceUID, %p=protocol, %r=instance number, %s=series number, %t=time, %u=acquisition number, %v=vendor, %x=study ID; %z=sequence name; default '%f_%p_%t_%s')

      • Jan 3, 2023  04:01 PM | Doug N
        RE: Extract date of scan from converted nifti files
        Thanks Chris,

        This is very helpful. Is there a way to only extract the date into the filename, rather than both the date and time?


        Doug

        • Jan 3, 2023  04:01 PM | Chris Rorden
          RE: Extract date of scan from converted nifti files
          The software is open source. You can make a fork and adjust it as you wish:
            https://github.com/rordenlab/dcm2niix/blob/bb3a6c35d2bbac6ed95acb2cd0df65f35e79b5fb/console/nii_dicom_batch.cpp#L3140
          Alternatively, you could write a Python script to adapt the filenames.

  • Dec 21, 2022  10:12 AM | Palkin Arora - DRDO-INMAS
    How to process bruker DTI files
    Hi, 

    I am working on animal data using Bruker 7T. How to convert the files into nifti, I am trying to do using dcm2niix, latest version. But I am not getting .bval and .bvec files to process my data in DTI studio. 

    once I select the diacom folder the dcm2nifti window gets freeze into non responding state.

    I am new to DTI studio, if possible can you help me with a pipeline for bruker DTI data processing in DTI studio.

    • Dec 21, 2022  12:12 PM | Chris Rorden
      RE: How to process bruker DTI files
      This sounds like a duplicate of 
        https://github.com/rordenlab/dcm2niix/issues/525
        https://github.com/rordenlab/dcm2niix/issues/265
      The core issue is that the DICOM b-matrix 0018,9602..0018,9607 is underspecified to create a FSL bvec file (the bvec [1 0 0] and [-1 0 0] create identical bmatrixes, the theoretical diffusion is the same, but the eddy currents are not).

      I have not seen a Broker scan in over a year, so it is possible they have fixed their DICOMs. Feel free to share your sample dataset with my institutional email:
        https://sc.edu/study/colleges_schools/artsandsciences/psychology/our_people/directory/rorden_chris.php

      However, my sense is that this is a limitation of your impoverished DICOM images, not dcm2niix. You should work with Bruker to ensure that archival data is created by your instrument.

  • Dec 6, 2022  03:12 PM | rbonicel
    Spectroscopy sequences conversion
    Dear Nick,

    I have a MRI protocol on a Philips Ingenia 3T machine that contains two spectroscopy sequences : HERMES and SVS_Press. I have exctracted said sequences in dcm image format, and converted them using dcm2niix version v1.0.20181125 (JP2:OpenJPEG) GCC9.3.0 (64-bit Linux), along with other sequences in the protocol.

    I get a .nii.gz and .json file for each of these two sequences, but I can't open them to see what the file contain.

    So my question is : is dcm2niix giving a meaningful .nii.gz conversion for spectro data ? I've also seen the spec2nii module that can be of use, as I on't know which one to use.

    Could you please help me see more clearly on that matter ?

    Best regards,
    Robin

    • Dec 6, 2022  04:12 PM | Chris Rorden
      RE: Spectroscopy sequences conversion
      Robin,
       I am not aware of anyone named Nick involved with the development of dcm2niix or spec2nii. dcm2niix is tuned for converting images, while spec2nii handles spectography data. I am not familiar with MRS, so perhaps you would be best served reading William T Clarke's web pages and generated an issue on those repositories if those do not resolve your questions.
         https://github.com/wtclarke/spec2nii
         https://github.com/wtclarke/mrs_nifti_standard

      • Dec 7, 2022  08:12 AM | rbonicel
        RE: Spectroscopy sequences conversion
        Dear Chris Rorden,

        Sorry, I got mixed up between my emails and this question. I meant to to write to you in the first place.

        Ok, so, what I get from your reply is that although we have dcm files for spectroscopy sequences that get converted without any issue to nifti format using dcm2niix, the result doesn't mean anything, and I should use spec2nii and indeed contact William T Clarke if I have any issue.

        Thank you for your reply.

        Best,
        Robin

  • Jan 26, 2015  03:01 PM | Nina Reislev - Danish Research Centre for Magnetic Resonance
    dcm2niix for Philips PAR/REC files
    Dear Chris Rorden,

    We have installed the newest version of the conversion software dcm2nii - which is now called dcm2niix, right?
    I would like to use it to convert Philips PAR/REC diffusion-weighted MRI files into nifti-files (Images and gradient directions, b-values).
    When using dcm2niix with the input-directory specified with the PAR/REC files, I get the error: Unable to find any DICOM images.
    It seems the software is unable to detect and convert PAR/REC files?
    I use previous versions of dcm2nii with PAR/REC without problems.

    Best Regards, Nina Reislev

    • Jan 26, 2015  08:01 PM | Chris Rorden
      RE: dcm2niix for Philips PAR/REC files
      Nina-
        Yes, the latest version of my software is dcm2niix. You can always get the latest stable version by downloading MRIcroGL, or if you are feeling brave you can compile the latest beta release from Github (https://github.com/neurolabusc/dcm2niix).
       The software will convert PAR/REC files just fine. You have three options (I tested this on OS X)
         1.) With MRIcroGL, select Import/ConvertDicomToNifti, then drag and drop your PAR file onto the new dcm2nii window.
         2.) With MRIcroGL, select Import/ConvertDicomToNifti. The dcm2nii window appears. This dcm2nii has an associated menu - select the menu item File/Par/RecToNifti - select the PAR file you wish to convert using the file selection dialog box.
        3.) You can also call dcm2niix from the command line, for example "./dcm2niix ~/Desktop/a.PAR"

      -chris

      • Jan 27, 2015  08:01 AM | Nina Reislev - Danish Research Centre for Magnetic Resonance
        RE: dcm2niix for Philips PAR/REC files
        Thank you, Chris, it works.
        I was using the command line, only specifying the directory path or ".REC" - it works when specifying ".PAR" as you write.
        For dicom files it suffice specifying the path.
        Best Nina.

        • Jan 27, 2015  02:01 PM | Chris Rorden
          RE: dcm2niix for Philips PAR/REC files
          The next version will allow you to specify either the .PAR (header data) or .REC (image data). As you note, for PAR/REC you specify each file (since they explicitly code a complete volume) rather than a folder (for DICOM a single volume typically spans multiple files).

          • Dec 6, 2016  05:12 PM | Luigi Antelmi
            RE: dcm2niix for Philips PAR/REC files
            Dear Chris,

            I've just cloned and compiled the source code from https://github.com/rordenlab/dcm2niix

            When I try to convert a (T1 3D) PAR (or REC) file it says:

            Chris Rorden's dcm2niiX version 25Nov2016 (64-bit Linux)
            Done reading PAR header version 4.2, with 1 volumes
            Error: unable to load t1.REC
            Conversion required 0.027482 seconds.

            with no other output. Any suggestion on how to make it work?

            Thank you very much!
            Luigi.

            • Dec 6, 2016  06:12 PM | Chris Rorden
              RE: dcm2niix for Philips PAR/REC files
              Luigi.
               This problem was specific to yesterday's development source code. You can either get the latest version or you can get a pre-compiled version from NITRC.

          Aug 26, 2021  05:08 PM | Rubina Chandnani - University of Stuttgart
          RE: dcm2niix for Philips PAR/REC files
          Hi Chris,

          I'm faced with a similar issue.

          I downloaded dcm2niix on Ubuntu 20.04 but when I type this command I get this error. Please see below:

          dcm2niix -o /mnt/c/Users/rubin/BIDS/sub-R0120062/func -z y /mnt/c/Users/rubin/Documents 2021/Germany/fMRI data/Motor imagery dataset/DICOM/Files/R0120062/source data/func.PAR

          Compression will be faster with 'pigz' installed
          Chris Rorden's dcm2niiX version v1.0.20181125 (JP2:OpenJPEG) GCC9.3.0 (64-bit Linux)
          Warning: only processing last of 6 input files (recompile with 'myEnableMultipleInputs' to recursively process multiple files)
          Error: Unable to find any DICOM images in data/func.PAR (or subfolders 5 deep)

          I would be so grateful if you could point out what I am doing wrong here or what I need to modify in the command line.

          Many thanks for your time in helping me out.

          Best,

          Rubina

          • Aug 26, 2021  06:08 PM | Chris Rorden
            RE: dcm2niix for Philips PAR/REC files
            You are using a version from 2018. My first suggestion is to try the latest stable release (v1.0.20210317) 
              https://github.com/rordenlab/dcm2niix/releases

            • Aug 26, 2021  08:08 PM | Rubina Chandnani - University of Stuttgart
              RE: dcm2niix for Philips PAR/REC files
              Thank you for your quick reply and for telling me to update to the latest version.

              I have downloaded and unzipped the file dcm2niix_lnx.zip but I don't know how to update to the latest version on Ubuntu 20.04.

              Can you please tell me how to do this?

              Thank you,

              Rubina

              • Aug 27, 2021  04:08 PM | Rubina Chandnani - University of Stuttgart
                RE: dcm2niix for Philips PAR/REC files
                Hi again,

                I tried the code again but this time in Anaconda Prompt with the updated version and still get the same error message:

                (base) C:\Users\rubin>dcm2niix C:\Users\rubin\BIDS\sub-R0120062\func C:\Users\rubin\Documents 2021\Germany\fMRI data\Motor imagery dataset\DICOM\Files\R0120062\source data\func.PAR
                Compression will be faster with pigz.exe in the same folder as the executable
                Chris Rorden's dcm2niiX version v1.0.20210317 MSC1916 (64-bit Windows)
                Warning: only processing last of 7 input files (recompile with 'myEnableMultipleInputs' to recursively process multiple files)
                Error: Input folder invalid: data\func.PAR

                I would be so grateful if you could point out what I need to fix here.

                Many thanks,

                Rubina

                • Aug 27, 2021  06:08 PM | Chris Rorden
                  RE: dcm2niix for Philips PAR/REC files
                  I notice there are spaces in your file path. When this occurs, you will want to use quotes for terminal programs so that they are able to detect that you are not providing multiple arguments:

                    C:\Users\rubin>dcm2niix "C:\Users\rubin\BIDS\sub-R0120062\func C:\Users\rubin\Documents 2021\Germany\fMRI data\Motor imagery dataset\DICOM\Files\R0120062\source data\func.PAR"

                  You may want to consider the terrific FSL training course, which has a lot of details for experts and beginners alike:
                    http://fsl.fmrib.ox.ac.uk/fslcourse/
                  The preparatory material has a lot of details that can help you work with the command line
                     http://fsl.fmrib.ox.ac.uk/fslcourse/#Preparatory
                  (You can run FSL on a Windows computer with the Windows Subsystem for Linux).

                  Andrew Jahn has some great videos as well:
                    https://www.youtube.com/watch?v=9ionYVXU...

        Sep 27, 2018  05:09 PM | Josh Robinson
        RE: dcm2niix for Philips PAR/REC files
        Hi Chris,

        I am having trouble using dcm2niix from the command line and I was hoping you would be able to help. I am trying to convert diffusion weighted PAR/REC files to nifti. I supply the path directly to the .par file, however it returns the error "Error: output folder invalid: /path/to/par/file" when I do not have the  -o option set. Alternatively, I give the path to the folder containing the par files, but it gives an error saying there are no dicom files in the specified folder. My (paraphrased) command is here:

        /path/to/executable -f outname /path/to/par/file

        When I use the GUI, it works just fine, but given the volume of data I need to convert, using the command line utility would be much more convenient, and given the simplicity of the command I don't see any error in my syntax. Would you have any ideas as to what may be going on here? Any guidance is greatly appreciated.

        Thank you,

        Josh Robinson

        • Sep 27, 2018  07:09 PM | Chris Rorden
          RE: dcm2niix for Philips PAR/REC files
          I can not replicate your issue. All of these commands work for me

          ./dcm2niix -f outname -o ~/tst/parx ~/tst/parx/b.PAR
          ./dcm2niix -o ~/tst/parx ~/tst/parx/
          ./dcm2niix ~/tst/parx/b.
          ./dcm2niix ~/tst/parx/
          • You may want to check that you are using a recent version, when I ran my copy I got Chris Rorden's dcm2niiX version v1.0.20180918 GCC6.1.0 (64-bit MacOS)
          • If any of your paths have spaces in them, make sure to wrap the argument in quotes.
          • Make sure you have the PAR and REC file in the same folder.

        Nov 28, 2018  09:11 AM | josephine g
        RE: dcm2niix for Philips PAR/REC files
        Hi Chis,

        I tried to use dcm2niix to convert PAR/REC images into nifti format, but can't seem to make it work.
        Can you help me identify what I'm doing wrong?

        command: dcm2niix $datadir/filename.PAR.gz -o $outdir
        output:
        Compression will be faster with 'pigz' installed
        Chris Rorden's dcm2niiX version v1.0.20180622 GCC4.8.2 (64-bit Linux)
        Error: Unable to find any DICOM images in /$datadir (or subfolders 5 deep)

        The PAR and REC files are in the same folder.

        Thanks!
        Josephine

        • Nov 28, 2018  11:11 AM | Chris Rorden
          RE: dcm2niix for Philips PAR/REC files
          Josephine -
            The name of the file you want to convert is always the LAST parameter provided. The rationale for this is that it supports operating systems where you drag and drop the file you want to convert onto the application. Therefore, your command should be
            dcm2niix -o $outdir $datadir/filename.PAR.gz
          run dcm2niix with no parameters 
            dcm2niix
          to get more help on proper usage. I would also recommend updating to the latest version.

          -chrs

          • Dec 3, 2018  01:12 PM | josephine g
            RE: dcm2niix for Philips PAR/REC files
            Hi Chris,

            Thanks for your pointers. I upgraded to the newest dcm2niix version and changed the command, but got the same error that the package is unable to detect any images. However, it seemed to locate the PAR files after uncompressing them (filename.PAR.gz > filename.PAR). 
            However, it now returns a different error related to the number of slices:

            path/to/new_version/dcm2niix -o /$outdir /$imgdir/filename.PAR

            Compression will be faster with 'pigz' installed
            Chris Rorden's dcm2niiX version v1.0.20181125 GCC4.8.2 (64-bit Linux)
            Warning: dcm2niix PAR is not actively supported (hint: use dicm2nii)
            Found 18950 slices, but expected divisible by 18962: slices*grad*bval*cardiac*echo*dynamic*mix*labels = 38*1*1*1*1*499*1*1
            /$imgdir
            Error: Total number of slices (18950) not divisible by slices per 3D volume (38) [acquisition aborted]. Try dicm2nii or R2AGUI: 
            /$imgdir


            It also reported an error related to the number of dynamics, which was inconsistent with the header info. This warning disappeared after manually changing the header (PAR file). 

            Can you give any advise on how to deal with the error above?
            Thanks!

            Best,
            Josephine

            • Dec 3, 2018  02:12 PM | Chris Rorden
              RE: dcm2niix for Philips PAR/REC files
              Looks like this was an incomplete acquisition, where the scanner was interrupted in the middle of acquiring a volume. I would follow the advice provided by dcm2niix and use dicm2nii.

              • Dec 3, 2018  04:12 PM | josephine g
                RE: dcm2niix for Philips PAR/REC files
                Thanks for your fast reply. This was a complete acquisition and the problem occurs with other subjects as well, which makes me believe there is an issue with inconsistent header info. I will try dicm2nii.
                Thanks!

        Jan 3, 2020  04:01 PM | Shilpi Modi - Thomas Jefferson University
        RE: dcm2niix for Philips PAR/REC files
        Originally posted by Chris Rorden:
        Nina-
          Yes, the latest version of my software is dcm2niix. You can always get the latest stable version by downloading MRIcroGL, or if you are feeling brave you can compile the latest beta release from Github (https://github.com/neurolabusc/dcm2niix).
         The software will convert PAR/REC files just fine. You have three options (I tested this on OS X)
           1.) With MRIcroGL, select Import/ConvertDicomToNifti, then drag and drop your PAR file onto the new dcm2nii window.
           2.) With MRIcroGL, select Import/ConvertDicomToNifti. The dcm2nii window appears. This dcm2nii has an associated menu - select the menu item File/Par/RecToNifti - select the PAR file you wish to convert using the file selection dialog box.
          3.) You can also call dcm2niix from the command line, for example "./dcm2niix ~/Desktop/a.PAR"

        -chris
        hi,

        When trying to convert Philips PAR REC files to nii using MRIcoGL I an getting the following warning:

        Compression will be faster with pigz.exe in the same folder as the executable
        Chris Rorden's dcm2niiX version v1.0.20190902 (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900 (64-bit Windows)
        Warning: dcm2niix PAR is not actively supported (hint: use dicm2nii)
        Warning: Distance between slices reported by slice gap+thick does not match estimate from slice positions (issue 273).
        Done reading PAR header version 4.2, with 4950 slices
        Philips Scaling Values RS:RI:SS = 1.64078:0:0.00206002 (see PMC3998685)


        Can this warning be override?

        Regards,

        Shilpi

        • Jan 3, 2020  05:01 PM | Chris Rorden
          RE: dcm2niix for Philips PAR/REC files
          You can not override these warnings. Depending on your data, you might be able to ignore these warnings. See issue 273. In general, I would strongly discourage using PAR/REC and export to DICOM. If you have issues, you may want to look at these pages:
            https://github.com/xiangruili/dicm2nii
            https://github.com/nipy/nibabel/blob/master/nibabel/cmdline/parrec2nii.py
            https://github.com/rordenlab/dcm2niix/tree/master/PARREC
          I do not have access to Philips hardware, so please validate carefully. I have not touched that code in a while, and it is an undocumented Philips research format that they have historically modified at will. My software does patch several known bugs from prior Philips releases, but these kludges may have unintended consequences.

          • Jan 9, 2020  08:01 PM | Shilpi Modi - Thomas Jefferson University
            RE: dcm2niix for Philips PAR/REC files
            Thank you so much for your guidance.

            Regards,

            Shilpi

      Dec 6, 2022  03:12 AM | ziqing zhao
      RE: dcm2niix for Philips PAR/REC files
      Dear Chris,

      I use the MRIcron to convert the dicom files into NII. But after it arise the warning
      'D:\Program Files\MRIcron\Resources\dcm2niix.exe -f "%f_%p_%t_%s" -p y -z y -o "H:\PHD\learning\research\dataset\EMBARC_task\reward_fmri_tp1_nii" "H:\PHD\learning\research\dataset\EMBARC_task\reward_fmri_tp1\CU0022CUMR1R1"
      Compression will be faster with pigz.exe in the same folder as the executable
      Chris Rorden's dcm2niiX version v1.0.20220720 (JP2:OpenJPEG) (JP-LS:CharLS) MSC1900 (64-bit Windows)'

      No any process and outcome return
      Can you provide any suggesstions?

      Thanks
      Alex

      • Dec 6, 2022  01:12 PM | Chris Rorden
        RE: dcm2niix for Philips PAR/REC files
        This is a duplicate of issue 650
          https://github.com/rordenlab/dcm2niix/issues/650
        You have three solutions:
         1. This will be resolved with the next stable release. You can ignore in the meantime and have slightly slower performance.
         2. You can compile the development branch from source.
         3. You can use a different operating system (macOS, Linux).


1   2   ...   10   Next >