Convert DICOM from Bruker Paravision to regular DICOM or Bruker Paravision to Nifti - GarzaLab/Documentation GitHub Wiki
Paravision adds a slope to all DICOM T1w data (that we know). This produces errors in our structural scripts. To avoid this, we need to do several steps:
Bruker DICOM to normal DICOM (no slope).
- Download DCMTK
sudo apt install dcmtk
- Prepare to run the command.
For this, we need to copy the *.dcm
from the original folder to a new folder. I recommend this because the old data is rewritten and you NEVER want to overwrite your originals.
mkdir dicom_new/subject1
cp dicom_raw/subject1/*.dcm dicom_new/subject1/
- Run
dcmodify
each subject or make a script.
dcmodify -e 0028,1052 -e 0028,1053 -e 0028,1054 dicom_new/subject1/*
This will delete the line with the slope and get your data with raw intensity for analysis.
Script example
root=/media/egarza/Elements2/projects/INB/LANIREM/pilotoMn/data
dicom=/media/egarza/Elements2/projects/INB/LANIREM/pilotoMn/data/dicom_seq
mincdir=/media/egarza/Elements2/projects/INB/LANIREM/pilotoMn/data/minc
for file in ${dicom}/AH53_nomn
do
i=$(basename $file)
# Remove rescale
dcmodify -e 0028,1052 -e 0028,1053 -e 0028,1054 ${file}/*
# Copy Bak files
mv ${file}/*.bak ${root}/dicom_bak/${i}/
# Convert Dicoms to Minc
dcm2mnc -usecoordinates -anon -dname ${i} -fname ${i}_t1 ${file} ${mincdir}
done
Bruker to Nifti
- Install Bruker2Nifti.
- Use the GUI or Command Line.
- Choose the whole folder or the folder that contains your sequence and convert that.
If you have Repetitions
Sometimes you want to increase SNR by adding repetitions of the same sequence. If that is the case, Bruker Paravision to DICOM will add all repetitions to the same folder, making it really hard to tell which is which. For that I use Bruker2Nifti
. It creates a nifti file with reps
time dimensions (i.e. 2 for 2 reps). You can use FSLsplit
to split the files by time.
bruker2nifti -i 20190605_131558_B03GrazaIsabelMang_AH81_1_1 -o test
After that you can average the images using antsRegistration and then