Skip to content
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

ZMT zurich med tech

  1. Home
  2. Sim4Life
  3. Anatomical Models
  4. How to import voxels from Matlab?

How to import voxels from Matlab?

Scheduled Pinned Locked Moved Anatomical Models
3 Posts 3 Posters 719 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dbsim4
    wrote on last edited by
    #1

    Hello,

    I think my question is related to this one: https://forum.zmt.swiss/topic/143/voxel-of-individual-anatomic-model-creates-holes

    I have an anatomical body model as a 3D matrix [x][y][z] in Matlab, with each entry as the index of a tissue. I also have a separate tissue descriptor file.

    What is the preferred format to go from Matlab -> Sim4Life to import the voxel model? I'm not able to import a .mat file.

    Also, can you please describe the steps to import & process the model (ie. create surfaces, etc.) necessary to properly use this model in an acoustic simulation?

    Thank you!

    brynB 1 Reply Last reply
    0
    • M Offline
      M Offline
      montanaro
      wrote on last edited by
      #2

      Not sure what the best way to do this, but I recently got a mesh in Matlab and I used stlwrite in matlab to export it as an Stl file which I then imported into S4L.

      Otherwise I'd try to reexport the xyz file into another format, but I'm not familiar with these formats.

      Sim4Life has it's own voxeler so I'd say the easiest way to be to export your voxels as a 3D model (one for each entity/tissue) and then use the Sim4Life voxeler engine to regenerate the voxels. This will also give you more flexibility in case you want to change the voxel resolution

      1 Reply Last reply
      0
      • D dbsim4

        Hello,

        I think my question is related to this one: https://forum.zmt.swiss/topic/143/voxel-of-individual-anatomic-model-creates-holes

        I have an anatomical body model as a 3D matrix [x][y][z] in Matlab, with each entry as the index of a tissue. I also have a separate tissue descriptor file.

        What is the preferred format to go from Matlab -> Sim4Life to import the voxel model? I'm not able to import a .mat file.

        Also, can you please describe the steps to import & process the model (ie. create surfaces, etc.) necessary to properly use this model in an acoustic simulation?

        Thank you!

        brynB Offline
        brynB Offline
        bryn
        ZMT
        wrote on last edited by
        #3

        @dbsim4 first to the second question:
        If you manage to import the voxels in Sim4Life, you can selected the LabelField entity and run the Image Tools / Generate Surfaces tool. I would recommend to turn on smoothing and simplification (edge length typically >= voxel size, depending on the feature size you want to preserve).

        To import the voxels in Sim4Life, you should write the voxels as a binary file (8-bit, 16-bit or 32-bit unsigned integer). A quick google search resulted in this MATLAB documentation page on writing binary data: https://ch.mathworks.com/help/matlab/ref/fwrite.html

        Alternatively, you could find a package to export the voxels as nifti file, and import the nifti file As LabelField (option in import dialog). The importer can also load an iseg tissue list, which assigns colors and names to the tissue labels. An iseg tissue list contains following information. First line is version, second line contains number of tissues not including background with label=0. The subsequent lines start with C and list the color (RGB-Alpha) and name.

        Example:
        V7
        N3
        C0.00 0.00 1.00 0.50 Bone
        C0.00 1.00 0.00 0.50 Fat
        C1.00 0.00 0.00 0.50 Skin
        
        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Search