You mean, you have a sequence of raw images? If you know the xyz dimensions and voxel spacing, and data type (char, int, short etc), you can write a simple NRRD header to describe the data. I think something like this probably work. You need to replace the type and sizes with correct value.
Really thanks for your quick reply.
I tried to make nrrd to refer your reply.
But when i load the nrrd file, following error occurs.
Error: Loading D:/2022.09.29 CT/slice.nrrd - Failed to read node slice_2 (vtkMRMLSequenceNode1) from filename=‘D:/2022.09.29 CT/slice.nrrd’
^ vtkMRMLVolumeArchetypeStorageNode::ReadDataInternal: Cannot read file as a volume of type Volume [fullName = D:/2022.09.29 CT/slice.nrrd]: 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/slice.nrrd [reader 0th file name = D:/2022.09.29 CT/slice.nrrd].
To be perfectly honest, I never tried building a nrrd header from sequence of images, but I know it is doable. Looking at the description of detached header more carefully, you may have to use the keyword LIST or define a filename formatting (min, max, increase). Try adding LIST right after data file or type
datafile: "Slice%04d 0 max_number_slices 1
3. Detached Headers with “data file:”
Detached headers allow data stored in one or more separate files, with or without headers of another format, to be accessed by a NRRD header, leaving the original file(s) intact. The line skip and byte skip fields are especially useful for these cases. Detached headers are also very useful in situations where very large amounts of data are to be read or written with direct IO, a very fast method of IO in which the device driver transfers data directly between blocks on disk and user-space memory (nrrd currently supports direct IO on SGIs, via the air library). Direct IO requires special alignment between the data segment beginning and the block boundaries on disk, which makes using attached headers rather inconvenient. Detached headers are also the simplest way to deal with NRRD readers which do not support the optional compressed encodings, since a stand-alone program (such as “gzip/gunzip” or “bzip2/bunzip2”) will be able to process the separate data file.
There is one new field specification which is required in detached headers, using the “data file” identifier. This field specification can take one of three possible forms (the second and third were copied from the MetaImage format).