# How can I import NIFTI files to DSCMRIAnalysis module?

**URL:** https://discourse.slicer.org/t/how-can-i-import-nifti-files-to-dscmrianalysis-module/3645
**Category:** Support
**Created:** [August 3, 2018, 12:05pm UTC](https://discourse.slicer.org/t/how-can-i-import-nifti-files-to-dscmrianalysis-module/3645 "2018-08-03T12:05:32Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![Kyu\_Sung\_Choi](https://avatars.discourse-cdn.com/v4/letter/k/b77776/32.png) [@Kyu\_Sung\_Choi](https://discourse.slicer.org/u/Kyu_Sung_Choi)
#### Post date: [August 10, 2018, 3:19am UTC](https://discourse.slicer.org/t/how-can-i-import-nifti-files-to-dscmrianalysis-module/3645/6 "2018-08-10T03:19:38Z")

</div>

Dear Dr. @pieper and Dr. @fedorov,

**Thank you so much!**  
**It works perfectly, and moreover, I think reading multiple DSC files in the folder works fine with the code below.** (There are a few warnings, though.)

import os  
import slicer  
import MultiVolumeImporter

path1 = “/home/cndl/DSC/test/4d\_nifti/”  
path2 = “/home/cndl/DSC/test/nrrd/”  
os.mkdir(path2)  
list = os.listdir(path1)

for filename in sorted(list):  
#[success, loadedVolumeNode] = slicer.util.loadVolume(path1+filename, returnNode=True) ## for 3D NIFTI  
importer = MultiVolumeImporter.MultiVolumeImporterWidget()

mvNode = slicer.mrmlScene.CreateNodeByClass(‘vtkMRMLMultiVolumeNode’)  
slicer.mrmlScene.AddNode(mvNode)

importer.read4DNIfTI(mvNode, path1+filename)  
fn\_ext = os.path.splitext(filename)  
true\_fn\_ext = os.path.splitext(fn\_ext[0])  
slicer.util.saveNode(mvNode, path2+true\_fn\_ext[0]+“.nrrd”)

exit()

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/5/35b234170779e4786673e23ee00cebcb3590c55c.png)

**_However, after I load these 3 NRRD files (test\_DSC, test2\_DSC, and TCGA-08-0524\_DSC.nrrd) and enter as input to DSCMRIAnalysis module in command line, it does not recognize frame identifying DICOM tag_** (error msg below). When I enter just 1 NRRD file saved with the code above as an input file, same error msg pops up. Maybe this NRRD file is not the same NRRD file that I obtained using mpReviewPreprocessor.py (the post you answer is linked [here](https://discourse.slicer.org/t/how-can-i-convert-dicom-series-to-nrrd-files-in-batch-mode/3421/9))

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/3/5389aa06ab1967604e5a10569fc6d69ef26733f7.png)

Could you please fix this problem?  
I always appreciate it.

All the best,  
Kyu Sung

---

_[View the full topic](https://discourse.slicer.org/t/how-can-i-import-nifti-files-to-dscmrianalysis-module/3645)._
