Eidors-logo    

EIDORS: Electrical Impedance Tomography and Diffuse Optical Tomography Reconstruction Software

EIDORS (mirror)
Main
Documentation
Tutorials
− Image Reconst
− Data Structures
− Applications
− FEM Modelling
− GREIT
− Old tutorials
Workshop
Download
Contrib Data
GREIT
Browse Docs
Browse SVN

News
Mailing list
(archive)
FAQ
Developer
                       

 

Hosted by
SourceForge.net Logo

 

Samples for the EIDORS Workshop

To run tutorials, you need to download and install EIDORS and then run this command in a matlab (or octave) session.
>>run /path/to/eidors3d/startup.m

EIDORS Workshop @ EIT 2017 Conf

  1. Create a directory tutorial
  2. Download eidors-v3.9-ng.zip and unzip into the directory
  3. Start Matlab
  4. In matlab, do
    • cd H:/path/to/tutorial/eidors-v3.9
    • startup
    • compare_2d_algs(1) %(this tests if eidors is working)
    • show_fem(ng_mk_cyl_models(3,[0],[])) %(this tests if netgen is working)
Challenge problem:
  1. Create a 3D elliptical cylinder with 16 circular electrodes (see here)
    fmdl= ng_mk_ellip_models([1,1.2,0.8],[16,0.5],[0.1]); show_fem(fmdl);
  2. Put a ball into the elliptical cylinder
    extra={'ball','solid ball = sphere(0.5,0.5,0.5;0.1);'};
    fmdl= ng_mk_ellip_models([1,1.2,0.8],[16,0.5],[0.1],extra);
    show_fem(fmdl);
  3. Put two balls into the elliptical cylinder
    extra={'ball','solid ball = sphere(0.5,0.5,0.5;0.1) or sphere(0.5,-0.5,0.5;0.1);'};
    fmdl= ng_mk_ellip_models([1,1.2,0.8],[16,0.5],[0.1],extra);
    show_fem(fmdl);
  4. Set the model to use adjacent current patterns
    stim = mk_stim_patterns(16,1,[0,1],[0,1],{}); fmdl.stimulation = stim;
  5. Simulate homogeneous voltages (background conductivity = 0.5);
    img = mk_image(fmdl, 0.5); vh = fwd_solve(img);
    show_fem(img);
  6. Simulate inhomogeneous voltages (ball conductivity = 1.0). Add noise.
    img.elem_data(fmdl.mat_idx{2})= 1.0; vi = fwd_solve(img); vi = add_noise(0.5, vi, vh);
    show_fem(img);
  7. Reconstruct the image using a GN solver
    imdl= mk_common_model('b2c2',16); imdl.stimulation = stim; imdl= select_imdl(imdl,{'Basic GN dif'}); img= inv_solve(imdl,vh,vi);
    show_fem(img);
  8. Reconstruct with a different hyperparameter (lower resolution)
    imdl.hyperparameter.value = .3; img= inv_solve(imdl,vh,vi);
    show_fem(img);
  9. Reconstruct the image using GREIT (see here)
    opt.noise_figure = 0.5;
    fmdl.normalize_measurements = 0;
    imdl = mk_GREIT_model(mk_image(fmdl,0.5), 0.25, [], opt);
    img= inv_solve(imdl,vh,vi);
    show_fem(img);
  10. Compare images for skip 4 stimulation/measurement pattern (see here)

EIDORS Workshop

  • Introduction

      CODE

      • Downloading and Installing EIDORS and Netgen
      • Test that EIDORS is working
      • EIDORS data structures
        • fwd_model
        • inv_model
        • rec_model
        • data
        • image
      • EIDORS functions overview
      • Documentation
        solvers forward and inverse solverse
        meshing Interface to FEM libraries: Netgen / GMSH / distmesh
        models FEM modelling tools
        external Read write external file formats
        graphics Graphics / Display functions

        algorithms Algorithms to process EIT images (time series)
        sample_data Some sample data (deprecated, now use data_contrib)
        examples Examples (deprecated, now use tutorials)
        tools low level EIDORS tools
        tests Tests for debugging (deprecated, now in UNIT_TEST
        arch Mex files and architecture specific code
        compatibility Compatibility with older matlab versions
        deprecated Older, deprecated EIDORS files
        overloads Override matlab functions to give extra features
      • Contributed Data
      • Defaults
      • Caching
        tic;
        fmdl= ng_mk_cyl_models(1,[16,.5],0.1)
        toc;
        
        fmdl.stimulation = mk_stim_patterns(16,1,[0,1],[0,1],{},1);
        img = mk_image( fmdl, 1);
        
        tic;
        vh = fwd_solve(img);
        toc
        
      • Challenge Questions:
        • What data are from a cute baby on EIDORS? load and display these data
        • What is the speedup for larger FEM models?
        • Look at inv_solve_diff_GN_one_step - what part is cached?
      • "EIDORS basics" tutorials

    • Forward Models

      • Finite Element Models (FEMs)
      • EIDORS FEM structure
        >> fmdl= ng_mk_cyl_models(1,[16,.5],0.1);
        >> fmdl.stimulation = mk_stim_patterns(16,1,[0,1],[0,1],{},1) 
        fmdl =
                             nodes: [1958x3 double]
                             elems: [7849x4 double]
                          boundary: [2326x3 double]
                  boundary_numbers: [2326x1 double]
                          gnd_node: 350
                      np_fwd_solve: [1x1 struct]
                              name: 'ng'
                         electrode: [1x16 struct]
                             solve: 'eidors_default'
                          jacobian: 'eidors_default'
                        system_mat: 'eidors_default'
                              type: 'fwd_model'
                           mat_idx: {[7849x1 double]}
            normalize_measurements: 0
                       stimulation: [1x16 struct]
        >> fmdl.stimulation(1)
        
        ans = 
        
             stimulation: 'Amp'
            stim_pattern: [16x1 double]
            meas_pattern: [13x16 double]
        
        >> fmdl.electrode(1)
        
        ans = 
        
            nodes: [114 115 116 117 118 119 415]
            z_contact: 0.0100
        
      • Use shape_library to obtain a human thorax contour
        shape = shape_library('get', 'adult_male','boundary');
      • make a 2d model with 16 electrodes (width 0.1) with electrode 1 on the sternum (remember the shape must be counter-clockwise)
        fmdl = ng_mk_2d_model({flipud(shape),0.1},[16 -.17],[0.1 20]); show_fem(fmdl)
      • make a similar 3d model
        fmdl = ng_mk_extruded_model({1, shape, [4,49]},[16,1,0.5],[0.05 0 -1 0 60]); show_fem(fmdl)
      • add contrast using elem_select
      • solve for internal voltages
      • visualize using calc_slices
      • visualize using show_3d_slices
      • calculate current
      • calculate Jacobian
      • visualize Jacobian
      • change current pattern to N/2-1
      • compare Jacobian
      • (FEM generation 2D and 3D, Netgen, sensitivity, voltage and current distributions, stimulation patterns )
      • Challenge Questions:
        • Compare the sensitivity for a slice of a 3D vs 2D tank. Why are they different?
        • Create images of current flow in the thorax with various values for lung conductivity. How do they vary?
      • Further Tutorials on Forward Modelling

    • Reconstructions

    • GREIT

      • String interface
      • Custom model (for a 2 ring cyl)
      • Use ng_write_opt to increase minimum elem size and build a coarse pig model
      • imdl1 = mk_GREIT_model (fmdl)
      • Set the lungs to have 0.3 conductivity
      • vh =
      • vi =
      • compare reconstructions
      • ( GREIT algorithm, adapting shape, background conductivity, working with sample data )
      • Further Tutorials on GREIT

    • Live data

    • Assorted Tutorials on specific applications of EIT

Last Modified: $Date: 2017-06-21 08:59:21 -0400 (Wed, 21 Jun 2017) $ by $Author: aadler $