Import NRRD format

Someone can provide sample NRRD format for my case?
I have raw sequence images as below.
slice0000.raw , slice0001.raw , slice0002, slice0003.raw…240

I tried to load NRRD with the help of a good person, but an error occurred.

[Error]
^ vtkMRMLStorageNode::ReadData: Failed to read node slice_1 (vtkMRMLScalarVolumeNode1) from filename=‘D:/2022.09.29 CT/slice.nrrd’
^ void __cdecl qSlicerIOManager::showLoadNodesResultDialog(bool,class vtkMRMLMessageCollection *) Errors occurred while loading nodes: “Error: Loading D:/2022.09.29 CT/slice.nrrd - load failed.\n”

[Used NRRD format]
NRRD0004
type: ushort
dimension: 3
sizes: 1000 800 240
encoding: raw
data file: ./slice0000
./slice0001
./slice0002
./slice0003
./slice0004

Could you please let me know what is wrong?
It will be really helpful for me.

Here is detailed error message.

^ vtkITKArchetypeImageSeriesReader::ExecuteInformation: Cannot open D:/2022.09.29 CT/X-Plane.nhdr. ITK exception info: error in unknown: Could not create IO object for reading file D:/2022.09.29 CT/X-Plane.nhdr
^ Tried to create one of the following:
^ BMPImageIO
^ BioRadImageIO
^ DCMTKImageIO
^ GDCMImageIO
^ GiplImageIO
^ JPEGImageIO
^ LSMImageIO
^ MGHImageIO
^ MINCImageIO
^ MRCImageIO
^ MetaImageIO
^ NiftiImageIO
^ NrrdImageIO
^ PNGImageIO
^ ScancoImageIO
^ StimulateImageIO
^ TIFFImageIO
^ VTKImageIO
^ MRMLIDImageIO
^ You probably failed to set a file suffix, or
^ set the suffix to an unsupported type.
^ Algorithm vtkITKArchetypeDiffusionTensorImageReaderFile(00000141540D0BA0) returned failure for request: vtkInformation (00000141587B0120)
^ Debug: Off
^ Modified Time: 209976
^ Reference Count: 1
^ Registered Events: (none)
^ Request: REQUEST_INFORMATION
^ FORWARD_DIRECTION: 0
^ ALGORITHM_AFTER_FORWARD: 1
^ vtkITKArchetypeImageSeriesReader::ExecuteInformation: Cannot open D:/2022.09.29 CT/X-Plane.nhdr. ITK exception info: error in unknown: Could not create IO object for reading file D:/2022.09.29 CT/X-Plane.nhdr
^ Tried to create one of the following:
^ BMPImageIO
^ BioRadImageIO
^ DCMTKImageIO
^ GDCMImageIO
^ GiplImageIO
^ JPEGImageIO
^ LSMImageIO
^ MGHImageIO
^ MINCImageIO
^ MRCImageIO
^ MetaImageIO
^ NiftiImageIO
^ NrrdImageIO
^ PNGImageIO
^ ScancoImageIO
^ StimulateImageIO
^ TIFFImageIO
^ VTKImageIO
^ MRMLIDImageIO
^ You probably failed to set a file suffix, or
^ set the suffix to an unsupported type.
^ Algorithm vtkITKArchetypeImageSeriesVectorReaderSeries(00000141540D43E0) returned failure for request: vtkInformation (00000141587BADF0)
^ Debug: Off
^ Modified Time: 211490
^ Reference Count: 1
^ Registered Events: (none)
^ Request: REQUEST_INFORMATION
^ FORWARD_DIRECTION: 0
^ ALGORITHM_AFTER_FORWARD: 1
^ vtkITKArchetypeImageSeriesReader::ExecuteInformation: Cannot open D:/2022.09.29 CT/X-Plane.nhdr. ITK exception info: error in unknown: Could not create IO object for reading file D:/2022.09.29 CT/X-Plane.nhdr
^ Tried to create one of the following:
^ BMPImageIO
^ BioRadImageIO
^ DCMTKImageIO
^ GDCMImageIO
^ GiplImageIO
^ JPEGImageIO
^ LSMImageIO
^ MGHImageIO
^ MINCImageIO
^ MRCImageIO
^ MetaImageIO
^ NiftiImageIO
^ NrrdImageIO
^ PNGImageIO
^ ScancoImageIO
^ StimulateImageIO
^ TIFFImageIO
^ VTKImageIO
^ MRMLIDImageIO
^ You probably failed to set a file suffix, or
^ set the suffix to an unsupported type.
^ Algorithm vtkITKArchetypeImageSeriesVectorReaderFile(00000141540D56A0) returned failure for request: vtkInformation (00000141587B00D0)
^ Debug: Off
^ Modified Time: 211597
^ Reference Count: 1
^ Registered Events: (none)
^ Request: REQUEST_INFORMATION
^ FORWARD_DIRECTION: 0
^ ALGORITHM_AFTER_FORWARD: 1
^ vtkITKArchetypeImageSeriesReader::ExecuteInformation: Cannot open D:/2022.09.29 CT/X-Plane.nhdr. ITK exception info: error in unknown: Could not create IO object for reading file D:/2022.09.29 CT/X-Plane.nhdr
^ Tried to create one of the following:
^ BMPImageIO
^ BioRadImageIO
^ DCMTKImageIO
^ GDCMImageIO
^ GiplImageIO
^ JPEGImageIO
^ LSMImageIO
^ MGHImageIO
^ MINCImageIO
^ MRCImageIO
^ MetaImageIO
^ NiftiImageIO
^ NrrdImageIO
^ PNGImageIO
^ ScancoImageIO
^ StimulateImageIO
^ TIFFImageIO
^ VTKImageIO
^ MRMLIDImageIO
^ You probably failed to set a file suffix, or
^ set the suffix to an unsupported type.
^ Algorithm vtkITKArchetypeImageSeriesScalarReader(00000141540D0BA0) returned failure for request: vtkInformation (00000141587BF580)
^ Debug: Off
^ Modified Time: 212406
^ Reference Count: 1
^ Registered Events: (none)
^ Request: REQUEST_INFORMATION
^ FORWARD_DIRECTION: 0
^ ALGORITHM_AFTER_FORWARD: 1
^ vtkMRMLStorageNode::ReadData: Failed to read node X-Plane (vtkMRMLMultiVolumeNode1) from filename=‘D:/2022.09.29 CT/X-Plane.nhdr’
^ ReadData: This is not a nrrd file
^ vtkMRMLStorageNode::ReadData: Failed to read node X-Plane (vtkMRMLDiffusionWeightedVolumeNode1) from filename=‘D:/2022.09.29 CT/X-Plane.nhdr’
^ vtkMRMLVolumeArchetypeStorageNode::ReadDataInternal: Cannot read file as a volume of type DiffusionTensorVolume [fullName = D:/2022.09.29 CT/X-Plane.nhdr]: FileFormatError. Number of files listed in the node = 0. File reader says it was able to read 1 files. File reader used the archetype file name of D:/2022.09.29 CT/X-Plane.nhdr [reader 0th file name = D:/2022.09.29 CT/X-Plane.nhdr].
^ vtkMRMLStorageNode::ReadData: Failed to read node X-Plane (vtkMRMLDiffusionTensorVolumeNode1) from filename=‘D:/2022.09.29 CT/X-Plane.nhdr’
^ ReadData: This is not a nrrd file
^ vtkMRMLStorageNode::ReadData: Failed to read node X-Plane (vtkMRMLVectorVolumeNode1) from filename=‘D:/2022.09.29 CT/X-Plane.nhdr’
^ vtkMRMLVolumeArchetypeStorageNode::ReadDataInternal: Failed to instantiate a file reader
^ vtkMRMLStorageNode::ReadData: Failed to read node X-Plane (vtkMRMLVectorVolumeNode2) from filename=‘D:/2022.09.29 CT/X-Plane.nhdr’
^ vtkMRMLVolumeArchetypeStorageNode::ReadDataInternal: Cannot read file as a volume of type Volume [fullName = D:/2022.09.29 CT/X-Plane.nhdr]: FileFormatError. Number of files listed in the node = 0. File reader says it was able to read 1 files. File reader used the archetype file name of D:/2022.09.29 CT/X-Plane.nhdr [reader 0th file name = D:/2022.09.29 CT/X-Plane.nhdr].
^ vtkMRMLStorageNode::ReadData: Failed to read node X-Plane (vtkMRMLScalarVolumeNode1) from filename=‘D:/2022.09.29 CT/X-Plane.nhdr’
^ void __cdecl qSlicerIOManager::showLoadNodesResultDialog(bool,class vtkMRMLMessageCollection *) Errors occurred while loading nodes: “Error: Loading D:/2022.09.29 CT/X-Plane.nhdr - load failed.\n”

I’ve just tried this and it works flawlessly.

I’ve used this MRHead.nhdr file:

NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: unsigned short
dimension: 3
space: left-posterior-superior
sizes: 256 256 130
space directions: (0,1,0) (0,0,-1) (-1.2999954223632812,0,0)
kinds: domain domain domain
endian: little
encoding: raw
space origin: (86.644897460937486,-133.92860412597656,116.78569793701172)
data file: MRHead%04d.raw 0 129 1

with filenames:

  • MRHead0000.raw
  • MRHead0001.raw
  • MRHead0002.raw
  • MRHead0129.raw

All the files can be downloaded from here.

Thanks lassoan.

For your advice, i found solution with someone helping.

Could you describe what was the problem and how you solved it (just to help the next person who may run into the same difficulty)? Thank you!

Hi, I edited text to use your attached nhdr file by notpad.
After editing text, it require “Enter” key one by one.
If i didn’t it, the error message occurs with [This is not Nhdr file]

NRRD0004 [Enter]
type: unsigned short [Enter]
dimension: 3 [Enter]
space: left-posterior-superior [Enter]
sizes: 1000 800 240 [Enter]
space directions: (0.0277307,0,0) (0,0.0277307,0) (0,0,0.0277307) [Enter]
endian: little [Enter]
encoding: raw [Enter]
datafile: slice%04d.raw 0 239 1 [Enter]

In additionally, i made .bat file. It can make NHDR file to refer original text file.

https://humantek-my.sharepoint.com/:u:/g/personal/sykim_humantek_onmicrosoft_com/Ect3zZ9xFAdLpWdJEB9SlXABAIERAnopIY8j7SYOK9xb9w?e=9DoETe