Image conversion

How to convert dat to nii

Hi @bidaoxiang,

If you’re referring to the mih/dat format, you should see another file with the .mih extension, which corresponds to the text header for that data file. If you can see that file, you should see that it references the .dat file in its file: entry, and you can convert it by providing that file as the argument to mrconvert, e.g.:

mrconvert file.mih file.nii

Thank you very much.The data here contains .dat and .roihdr files,and then how to convert .dat file to .nii file.

I ran this command and there are two error messages.
mrconvert myometrium-ImageROI.dat myometrium-ImageROI.nii
mrconvert: [ERROR] unknown format for image “myometrium-ImageROI.dat”
mrconvert: [ERROR] error opening image “myometrium-ImageROI.dat”

OK, .roihdr is definitely not one of ours… Might be a format specific to DTIStudio, maybe? Either way, we don’t support this format, you would need to use the software package that generated this image to convert this back to NIfTI – assuming it provides a way to do this.

Alternatively, if the contents of the .roihdr file is plain text, you may be able to convert it to a corresponding .mih file, and we would then be able to convert your .dat file (assuming it contains just the image voxel intensities). If it is plain human-readable text, feel free to post it here and we may be able to suggest how to deal with it.