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. CAD Modeling
  4. The shape of the T1 image and the shape of the electric field are different

The shape of the T1 image and the shape of the electric field are different

Scheduled Pinned Locked Moved CAD Modeling
4 Posts 2 Posters 56 Views 2 Watching
  • 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.
  • L Offline
    L Offline
    lucky_lin
    wrote last edited by
    #1

    I used the IXI025-Guys-0852-T1 image for head segmentation and then performed TI (tissue imaging) simulation. However, I found that the shape of the T1 image and the shape of the electric field are different. My simulation grid setting is 1 mm. Why is this the case?b7bbe15a-8844-4142-9372-06a204a6f2d4-image.png

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lucky_lin
      wrote last edited by
      #2

      I tried to change the grid size but still couldn't make it exactly the same as the T1 image. I wonder if it's possible to control the electric field slices to be exactly the same as the T1 image.

      1 Reply Last reply
      0
      • brynB Offline
        brynB Offline
        bryn
        ZMT
        wrote last edited by bryn
        #3

        You don't have the same resolution (grid spacing) in the T1 image and the efield...!
        To visualize the two "fields" on the same grid, drag the T1w image to the analysis explorer, and interpolate it on the e-field grid.

        The interpolator has two inputs:

        1. T1w image (input field)
        2. E-field (target grid)

        Here is a snippet to show this could be done in Python

        import s4l_v1.analysis as analysis
        import s4l_v1.document as document
        import s4l_v1.model as model
        
        # Add a new ModelToGridFilter
        inputs = []
        model_to_grid_filter = analysis.core.ModelToGridFilter(inputs=inputs)
        model_to_grid_filter.Name = "Image"
        model_to_grid_filter.Entity = model.AllEntities()["T1w-image"]  # The model entity corresponding to the T1w-image
        model_to_grid_filter.UpdateAttributes()
        
        # Add a new SimulationExtractor
        simulation = document.AllSimulations["EM"]
        simulation_extractor = simulation.Results()
        
        # Add a new EmSensorExtractor
        em_sensor_extractor = simulation_extractor["Overall Field"]
        em_sensor_extractor.FrequencySettings.ExtractedFrequency = u"All"
        
        # Add a new FieldInterpolationFilter
        inputs = [model_to_grid_filter.Outputs[""], em_sensor_extractor.Outputs["EM E(x,y,z,f0)"]]
        field_interpolation_filter = analysis.core.FieldInterpolationFilter(inputs=inputs)
        field_interpolation_filter.UpdateAttributes()
        document.AllAlgorithms.Add(field_interpolation_filter)
        

        Then you will have the same grid and array ordering, and can overlay the T1w image and the field (or display them side by side with identical aspect ratio).

        Note if your simulation grid is not uniform, matplotlib will depict the anatomy in a distorted way.
        Btw, you could also interpolate in the other direction ...

        L 1 Reply Last reply
        0
        • brynB bryn

          You don't have the same resolution (grid spacing) in the T1 image and the efield...!
          To visualize the two "fields" on the same grid, drag the T1w image to the analysis explorer, and interpolate it on the e-field grid.

          The interpolator has two inputs:

          1. T1w image (input field)
          2. E-field (target grid)

          Here is a snippet to show this could be done in Python

          import s4l_v1.analysis as analysis
          import s4l_v1.document as document
          import s4l_v1.model as model
          
          # Add a new ModelToGridFilter
          inputs = []
          model_to_grid_filter = analysis.core.ModelToGridFilter(inputs=inputs)
          model_to_grid_filter.Name = "Image"
          model_to_grid_filter.Entity = model.AllEntities()["T1w-image"]  # The model entity corresponding to the T1w-image
          model_to_grid_filter.UpdateAttributes()
          
          # Add a new SimulationExtractor
          simulation = document.AllSimulations["EM"]
          simulation_extractor = simulation.Results()
          
          # Add a new EmSensorExtractor
          em_sensor_extractor = simulation_extractor["Overall Field"]
          em_sensor_extractor.FrequencySettings.ExtractedFrequency = u"All"
          
          # Add a new FieldInterpolationFilter
          inputs = [model_to_grid_filter.Outputs[""], em_sensor_extractor.Outputs["EM E(x,y,z,f0)"]]
          field_interpolation_filter = analysis.core.FieldInterpolationFilter(inputs=inputs)
          field_interpolation_filter.UpdateAttributes()
          document.AllAlgorithms.Add(field_interpolation_filter)
          

          Then you will have the same grid and array ordering, and can overlay the T1w image and the field (or display them side by side with identical aspect ratio).

          Note if your simulation grid is not uniform, matplotlib will depict the anatomy in a distorted way.
          Btw, you could also interpolate in the other direction ...

          L Offline
          L Offline
          lucky_lin
          wrote last edited by
          #4

          @bryn Can I export the new T1.nii.gz file? The T1 and the electric field seem to be in opposite directions along the x-axis. If I can export it, will the new T1 have the same orientation as the original one?

          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