Dicom to rectilinear grid vtk

How can I create rectilinear grid .vtk file from DICOM flies, please? I used to be able to do this using slicer. Any help will be much appreciated. Thank you.

You can load the DICOM image and then when you save it choose the .vtk file format. You will see a warning because .vtk file format cannot store image axis directions, but the file is still saved.

Thank you for your answer. I have tried this and is giving me structured grid vtk file not a rectilinear grid. What I need is rectilinear grid vtk file. Thank you

VTK files are confusing because they may store many types of data. What would you actually like to save: a labelmap image, a surface mesh, or a volumetric mesh?

They are DICOM files.

You import DICOM files into Slicer. What would you like to then save - a grayscale image, a label image, a surface mesh, or a volumetric mesh? What software will use that file and how?

I need a VTK rectilinear grid to use it in bonemat software. I suppose is a gray scale image as I need the gray scale.
Thank you

Bonemat can load the image that you saved in .vtk format.

Saving in Slicer:

Saved .vtk file loaded into bonemat and displayed in OrthoSlice view:

By the way, it seems that all that bonemat can do you can already do in Slicer. For the parameter mapping from CT densities to mechanical properties you can use a few lines of Python code (or using py_bonemat_abaqus). The license of bonemat is quite restrictive and you can do so much more in Slicer that I would recommend to consider using just Slicer for your workflow.

I was unaware that Slicer could map material properties from CT scan data as I am unfamiliar with this software. For example, I used Slicer to create a rectilinear grid vtk file, but now it only makes a structured grid vtk file. Please direct me on how Slicer can do this. Also, is the resulting file with mapped materials compatible with Abaqus software? Also, I am not that familiar with Python code.
In Bonemat, I can see this file, but it is not mapping anything on my mesh. The error I get is “scalar visibility: false”. I have looked to see how to fix this error, but I need help finding something.
On the other hand, I used pybonemat for Abaqus, which looks like a better variant than Bonemat. However, I have tried with both vtk and DICOM files, and I got the following errors:
“AttributeError: Dataset does not have attribute ‘ImagePositionPatient’.”
“ValueError: Error reading VTK header, unrecognised format” the vtk file was created with Slicer.
Thank you very much for your help.