Giter Site home page Giter Site logo

gibboncode / gibbon Goto Github PK

View Code? Open in Web Editor NEW
177.0 20.0 56.0 2.57 GB

The Geometry and Image-Based Bioengineering add-On for MATLAB

Home Page: http://gibboncode.org/

License: GNU Affero General Public License v3.0

MATLAB 99.15% TeX 0.80% GLSL 0.04%
finite-element-analysis tetgen segmentation geometry matlab visualization

gibbon's Introduction

GIBBON

Cite GIBBON: DOI

License: License

Join chat: Join the chat at https://gitter.im/GIBBONchat/Lobby

Table of contents

Project summary

GIBBON (The Geometry and Image-Based Bioengineering add-ON) is an open-source MATLAB toolbox, which includes an array of image and geometry visualization and processing tools and is interfaced with free open source software such as TetGen, for robust tetrahedral meshing, and FEBio for finite element analysis. The combination provides a highly flexible image-based modelling environment and enables advanced inverse finite element analysis.

GIBBON overview

Application highlights

Segmentation

GIBBON offers image filtering and smoothing methods, and has a graphical user interface for 3D image segmentation (HELP_imx.m). The segmented image data can be converted to 3D surface models (DEMO_imx_levelset_surface_compare) which can be meshed for FEA (HELP_runTetGen).

Computer Aided Design (CAD) tools

Using GIBBON, geometry can be imported from common mesh based CAD files (such as STL, HELP_import_STL). For generating geometries within MATLAB®, GIBBON also provides several CAD-style commands such as polygon rounding (HELP_filletCurve), revolution (HELP_polyRevolve), extrusion (HELP_polyExtrude), and sweeping and lofting (HELP_polyLoftLinear and HELP_sweepLoft). Simple geometries such as spheres (HELP_geoSphere), boxes (HELP_quadBox), platonic solids (HELP_platonic_solid), and rhombic dodecahedra (HELP_rhombicDodecahedron) can also be directly created using GIBBON.

Surface meshing tools

2D multi-region triangular meshing (e.g. HELP_regionTriMesh2D and HELP_multiRegionTriMeshUneven2D), resampling meshes geodesically (DEMO_geodesic_remeshing), smoothing (DEMO_surface_smooth_methods), and surface mesh refinement (e.g. HELP_subtri, HELP_subTriDual and HELP_subQuad), mesh type conversions (e.g. HELP_tri2quad, HELP_quad2tri), and mesh dual computation (HELP_patch_dual). Geometries can also be exported to the STL format e.g. for computer aided manufacture and 3D printing.

Volumetric meshing

Tetrahedral meshing (and constrained Delaunay tessellation) of multi-region domains is enabled through an interface with the TetGen package (HELP_runTetGen and HELP_constrainedDelaunayTetGen). Hexahedral meshes for some geometry types can be directly coded (e.g. spheres HELP_hexMeshSphere, boxes HELP_hexMeshBox and lattices HELP_element2HexLattice). For general input surfaces multi-region mixed tetrahedral-hexahedral meshing is also available (e.g. DEMO_MixedTetHexMeshing).

Lattice structures

One method to generate surface geometry for lattices is the use of triply-periodic functions (HELP_triplyPeriodicMinimal). Functions to convert element descriptions, such as tetrahedral and hexahedral elements, to lattice structures have also been implemented (HELP_element2lattice and HELP_element2HexLattice). These allow for the creation of 3D boundary conforming lattice structures on arbitrary input geometry. Exporting of hexahedral elements is also supported allowing for FEA on the created lattice structures (DEMO_febio_0026_hexlattice_compression).

Finite Element Analysis

For finite element analysis GIBBON currently links with either the free and open source software FEBio or with Simulia ABAQUS. Both the FEBio and ABAQUS interface is based on MATLAB® structures. The image below shows the coding of a material section in a MATLAB® structure (top row) and how these components are represented in the input files for FEBio or ABAQUS (bottom row). Through this structure to input file conversion process any FEBio or ABAQUS functionality can be directly coded in MATLAB®.

FEBio

GIBBON can be used as a pre- and post- processor for FEBio as it enables code-based development of meshes, boundary conditions, and input files. FEBio files can be directly exported based on dedicated MATLAB® structures (HELP_febioStruct2xml). Furthermore, GIBBON can be used to start and control FEBio simulations. As such, iterative and inverse FEA (e.g. based on MATLAB® optimization routines) is also enabled. All DEMO_febio_... files are FEBio demos, e.g. DEMO_febio_0001_cube_uniaxial is a simple uniaxial loading example, and DEMO_febio_0042_inverse_FEA_cube_uniaxial is an example of inverse FEA.
The image below is for large strain analysis of a twisting bar and stems from the demo DEMO_febio_0004_beam_twist. Other demos cover tension, compression, shear, applied forces, applied pressures, applied displacements, bending, poroelasticity, dynamic and viscoelastic analysis, contact and indentation problems, multi-generational materials for pre-load analysis.

Abaqus

The interface for ABAQUS is a recent development. Users can look at HELP_abaqusStruct2inp to study how input files are coded. The demo DEMO_abaqus_0001_cube_uniaxial is for uniaxial loading of a cube and steps through geometry creation, setting up the ABAQUS structure, saving the .inp file, running the job, and importing the results for visualization. Data is imported into MATLAB® using importAbaqusDat which parses ABAQUS .DAT files.

Visualization

GIBBON expands the standard MATLAB® visualization capabilities by adding 3D image and voxel visualization (HELP_im2patch and HELP_sliceViewer), meshed geometries (HELP_gpatch and HELP_meshView), finite element models (HELP_element2patch), and colormapped vector data (HELP_quiverVec), and all visualization methods enable multiple colormaps to be used in each figure or axis window. Furthermore GIBBON offers a custom figure window cFigure containing 3D rotation options (HELP_vcw) that mimic CAD behavior of 3D scene rendering, and high quality figure exporting options (HELP_efw). Advanced graphics animation creation and exporting capabilities through a figure window based GUI are also enabled (HELP_anim8).

Installation

Summary

  1. Download GIBBON
  2. Just run: installGibbon.m (found in GIBBON's main folder) and provide a link to where FEBio is installed during installation

More detailed installation instructions

The steps below guide you through a streamlined installation procedure using the installGibbon.m function*.

*If you prefer manual installation do the following: 1) Add the GIBBON folder (with subfolders) to the path and save the path definitions, 2) Run createHelpDemoDocumentation.m to integrate the help and documentation, 3) For the 3rd party packages: Go to the config folder in ../GIBBON/config and edit the FEBioPath.txt file to contain the full path to the FEBio executable

1. Get a copy of GIBBON

To use GIBBON you need to create a copy on a local directory on your machine. Obtain a copy by downloading and unzipping the latest zip file or clone GIBBON instead e.g. using: git clone https://github.com/gibbonCode/GIBBON.git. You can place the GIBBON folder anywhere on your machine, however, MATLAB (and the 3rd party packages listed below) may have file permission limitations for some locations which you may need to address*.

* For instance, some of GIBBON's features, such as those associated with TetGen and FEBio, regularly create and delete temporary files. As such MATLAB (and the 3rd party packes) should have full permissions for these folders. First of all users should make sure MATLAB has full (e.g. read/write/delete) permissions for the entire GIBBON folder (and its sub-folders). On some platforms the 3rd party packages require special treatment. For instance some OSX users have found it necessary to give tetGen or FEBio particular file permissions. For instance in the case of TetGen related features using git update-index --chmod=+x path/to/tetgen.

2. Setting up 3rd party packages

Below is a list of 3rd party packages that are required for full functionality. All all included with GIBBON except for FEBio which users need to download and install. You may skip FEBio installation if finite element analysis (with FEBio) is not desired.

Package Description Included? Download
FEBio
FEBIO
FEBio is a finite element solver and is used in GIBBON for all finite element analysis. Use of FEBio is featured in the many DEMO_FEBio... files. FEBio version 2.5.0 or newer is recommended. No FEBio website
export_fig
export_fig
export_fig helps to export publication quality images (e.g. .png, .jpg, .pdf, .eps), in GIBBON it is integrated in the export figure widget efw to export such images from the cFigure window directly. export_fig is also used for exporting images for creation of .gif animations with the GIBBON anim8 function. Yes export_fig page on GitHub
TetGen
TetGen
Is used for tetrahedral meshing (and possibly constrained 3D Delaunay tessellation). See for instance HELP_runTetGen.m. Yes For other versions: TetGen website

2. Install GIBBON

By running installGibbon.m the GIBBON, FEBio, and export_fig path definitions will be added and saved to MATLAB. The help and documentation will also be integrated. Once finished you will be asked to restart MATLAB. installGibbon.m can be found in the main GIBBON folder.

Getting started

Access the integrated help

  • To access the help documentation from MATLAB simply type: gdoc which will open the GIBBON documentation page in MATLAB's help brower. The documentation which is searchable and integrated just like the rest of MATLAB's help and documentation. You can also find this page manually under Supplemental Software as shown below.
  • To open GIBBON documentation for a particular function can use gdoc <functionName> (similar to MATLAB's doc function). For instance for help on im2patch use gdoc im2patch. This will search the integrated help for im2patch and display the results.

Help integration

Where to find functions and the executable help and demo files

  • The lib folder contains all GIBBON's functions.

  • The lib_ext folder contains external functions and libraries developed by others.

  • The docs folder contains the help & documentation files, and demo files which when "published" (using MATLAB's publish functionality) create the .html documentation files (found in docs/html) which are integrated in MATLAB.

  • The source for the help information for any function functionName is named HELP_functionName, and  the source for demos have DEMO_ as part of the name. Therefore if one is interested in reproducing or starting off from codes in the help and documentation simply start typing code names starting in HELP_ or DEMO_ in the MATLAB command window, e.g. HELP_ind2patch can be used to generate the help information for the ind2patch function. Users can start editing the file by typing open HELP_ind2patch in the command window. By publishing (use gpublish <HELP_functionName>) the HELP_ or DEMO_ files .html files are created in the docs\html folder. As such if users alter or contribute code in the lib folder and generate associated HELP_ or DEMO_ files, new help and documentation is then added and rendered on the website. For new help and documentation to become integrated in MATLAB run the createHelpDemoDocumentation function and restart MATLAB.

  • Many of the DEMO_ files focus on the use of FEBio. The demo DEMO_febio_0001_cube_uniaxial for instance features a simple cube subjected to a uniaxial load. Other demos focus on different load types, single versus multi-step analysis, different materials and inverse analysis (e.g. DEMO_febio_0042_inverse_FEA_cube_uniaxial).

Testing

GIBBON's core functionality can be tested by running testGibbon('all','test');. Use testGibbon('demo','test'); or testGibbon('help','test'); for running the demo or help files only.
GIBBON is currently developed and tested using the most recent version of MATLAB (or the latest pre-release) and has been tested on Windows 10, Ubuntu 20.04, and Mac OS. Most of GIBBON's functionality is compatible with older MATLAB versions, especially MATLAB R2014a and newer (Delaunay tessellation and toolbox help integration are among things that have undergone large changes). Please inform the developers (or open an issue) if a particular function does not work for your MATLAB environment. It is likely that codes can be easily altered to work for your version.
A large portion of GIBBON's functionality does not rely on special MATLAB toolboxes. However some functions do. Here is a list of toolboxes which appear to be used in GIBBON:

  • Image Processing Toolbox
  • Statistics and Machine Learning Toolbox
  • Symbolic Math Toolbox
  • Curve Fitting Toolbox
  • Parallel Computing Toolbox

License

GIBBON is provided under: License. The license file is found on the GitHub repository.

Citing GIBBON

If you use GIBBON in your work you should cite the following paper:
DOI

Moerman, (2018). GIBBON: The Geometry and Image-Based Bioengineering add-On. Journal of Open Source Software, 3(22), 506, https://doi.org/10.21105/joss.00506

Contributing

We'd love for you to contribute to GIBBON or even to join the development team! We welcome all sorts of contributions including technical content, documentation developments, or website improvements. Please read our contributing guidelines.

You can also ask questions and learn more about contributing via Gitter chat: Join the chat at https://gitter.im/GIBBONchat/Lobby

Code of conduct

See CODE_OF_CONDUCT

Roadmap

See ROADMAP

gibbon's People

Contributors

a-quinn avatar b-fitzgibbon avatar dependabot[bot] avatar iancberg avatar jamieconcannon avatar kevin-mattheus-moerman avatar modenaxe avatar natacalc avatar sebastiencallens avatar siddhantk avatar tesibio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gibbon's Issues

How to plot element_data that looks like using MATLAB function patch for ploting node_data

Hi, I've tried to import the element_data stress sx, sy, sxy and element centroid x,y,z manualy and transform the stress into radial and theta direction. However, when I tried to plot a 3D view of stress data. I found that I just saw the DEMO of plotting nodal_data using patch function and plotting stress value in 2D plot like a stress strain(or stretch) curve. Is there a way to plot element_data like stress or pressure so that I can see them like the plot shown by using patch or the plot of stress shown in Postview?

How to assign the direction and material properties of of each fiber with Gibbon?

Hi, I have a matrix (8*8) of all the fiber direction in 2D in the order of their element number.
Is there a way to assign each fiber direction by their element number or their location?
My model is a solid mixture composed of viscoelastic neo-Hookean with exponential fibers uncoupled.
I don't want to use a built in distribution to prescribe the fiber direction.

FAILED: Log file was not created in time. FEBio likely failed prior to logfile creation!

Hi,

While running DEMO_FEBio_active_contraction_01 in GibbonCode-Documentation, I received following warning with failed operation:

--- STARTING FEBIO JOB 
Waiting for log file...
Warning: --- FAILED: Log file was not created in time. FEBio likely failed prior to logfile creation! ---
15-Feb-2019 15:50:14 
> In runMonitorFEBio (line 157)
  In Febio_active_contraction (line 270) 
Warning: Try setting FEBioRunStruct.runMode to "internal" to see potential errors prior to log file creation 
> In runMonitorFEBio (line 159)
  In Febio_active_contraction (line 270) 
--- Failed or ended! --- 15-Feb-2019 15:50:14

Also, following the advice I tried to update code to use febioStruct2xml

Warning: febStruct2febFile is depricated and will be removed in future releases. Update your codes to use
febioStruct2xml, see HELP_febioStruct2xml (furthermore febio_spec version 2.5 is recommended) 

I am enclosing two codes for version 2 and 2.5. I am quite confused with syntax of version 2.5. It is probably because I am not familiar (new to FEBio) with version 2. For example:

% What would be alternative to elementdata in version 2.5 
%febio_spec.Geometry.ElementData.mat_axis.ElementIndices=1:1:size(E,1);
%febio_spec.Geometry.ElementData.mat_axis.Basis=VF_E;

Febio_active_contraction.m.zip
Febio_Active_contraction_v2_5.m.zip

How to pick the cylindrical inner, middle and ourter surface if I import a hex mesh from .feb file?

Hi, I'm trying to import the two-layer hollow cylinder with hex8 mesh from a .feb file, but after the import, I found that I can get the CE, E and V. And then I can derived from those to have F, C.
However, when I try to select the inner, middle and outer surface to prescribe the biphasic contact and prescribed radial boundary conditions, I found that in the Demo the radial face boundary markers are always selected by Cb generated by tetgen. I cannot find the radial prescribed face boundary markers in all the DEMO. The only assigned face boundary markers I can find are the top and bot part of the cylinder.
Is there a way to generate the face boundary markers without also importing the nodal_id of the selected boundary node set?
I had provided my .feb in one of the email before, but for clarity, I provide it here with the dropbox link here again if there is any confusion.(https://www.dropbox.com/s/q49d5c8osdtsh9c/BiphasicElasticContractionTube.feb?dl=0)

%% Access model element and patch data
F=meshOutput.faces;
V=meshOutput.nodes;
C=meshOutput.faceMaterialID;
E=meshOutput.elements;
CE=meshOutput.elementMaterialID;

Fb=meshOutput.facesBoundary;
Cb=meshOutput.boundaryMarker;

Improve vcw to work for plots/graphs that do not use axis equal.

The vcw function (view control widget) helps rotate/explore 3D visualizations just like one is used to with CAD packages. However, currently this only works well for graphics with axis equal on. Currently vcw scales the axes which may distort plots where the axis units are not equal.

tetGen meshing error

Hi, I'm trying to run tetGen on a segment of a femur from an imported STL file, however I keep getting this error.

"Found two nearly self-intersecting facets.
1st: [8938, 8981, 9339] #1
2nd: [8938, 8981, 9440] #1
The dihedral angle between them is 0.0939087 degree.
Hint: You may use -p/# to decrease the dihedral angle tolerance 0.1 (degree).
A self-intersection was detected. Program stopped.
Hint: use -d option to detect all self-intersections.
--- Done --- 10-Sep-2019 14:51:12".

How can I stop self-intersection?

My inputs are:
% define face boundary markers
faceBoundaryMarker = ones(size(F,1),1);

% define region points
V_regions = [0 0 0];
V_holes = [];

% regional mesh volume parameter
[regionA] = tetVolMeanEst(F,V); %Volume for regular tets

% create input structure
stringOpt = '-pq1.2AaY';

inputStruct.stringOpt=stringOpt;
inputStruct.Faces=F;
inputStruct.Nodes=V;
inputStruct.holePoints=V_holes;
inputStruct.faceBoundaryMarker=faceBoundaryMarker; %Face boundary markers
inputStruct.regionPoints=V_regions; %region points
inputStruct.regionA=regionA;
inputStruct.minRegionMarker=2; %Minimum region marker
inputStruct.modelName=modelName;

% mesh model using tetrahedral elements using tetgen
[meshOutput]=runTetGen(inputStruct); %Run tetGen

Installation: best way to chmod +x where necessary?

I tried running the example file /DEMO_MixedTetHexMeshing.m and at one point it gracefully failed with:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--- Writing SMESH file --- 15-Jan-2018 14:03:11
----> Adding node field
----> Adding facet field
----> Adding holes specification
----> Adding region specification
--- Done --- 15-Jan-2018 14:03:11
--- Running TetGen to mesh input boundary--- 15-Jan-2018 14:03:11
/bin/bash: /Users/will/Repo/External/GIBBON/lib_ext/tetGen/mac64/tetgen: Permission denied
--- Done --- 15-Jan-2018 14:03:11

Now, that's an easy fix in my case:

chmod +x /Users/will/Repo/External/GIBBON/lib_ext/tetGen/mac64/tetgen

But I wonder whether it would make sense to somehow automate this for all needed files. Are there best practices for doing this within Matlab itself? (I'm guessing the chmod settings aren't reliably preserved after a git clone but I could be wrong.)

Paper review

openjournals/joss-reviews#506

I'm really impressed by the breadth and ease-of-installation of this comprehensive Matlab toolbox. Thanks for the great effort!

For the text of the paper, I have minor tidbits to suggestion improvements; let me know if anything is unclear:

  • Possible repetition: (but okay if you want to keep it for emphasis)

    an open-source MATLAB® toolbox providing a single open-source framework

  • Missing comma:

    ‘Using GIBBON geometry’ → ‘Using GIBBON, geometry’

  • Missing space:

    continuum mechanics[@Moerman2017a]

  • Perhaps word improvement:

    ‘However, several CAD style commands have also been implemented in GIBBON’
    → ‘In addition, for generating simple geometries within MATLAB, GIBBON also provides several CAD-style commands’

  • Typo: ‘smoothening’

  • Can be simplified:

    ‘Lattice structures: Various lattice structure tools have been implemented.’ → could be just, e.g., ‘Lattice structure tools:’. Or if the opening sentence is kept, use it to explain what contexts the lattice structure tools are used in.

  • FEBio:

    • GIBBON interfaces with the free software [FEBio](http://febio.org/) [@Maas2012] for FEA — should probably spell out FEA here.

    • GIBBON can be used as a pre- and post- processor for FEA — or for FEBio?

    • it enables the code based development → ‘ it enables code-based development’

  • Visualization — this dot point is inconsistent with the rest; should have a colon and no newline.

  • Nested references end up having double parentheses; not sure if I'd prefer dropping the outer ones? I understand this probably isn't quite as flexible as a standard LaTeX workflow :)

    ([@Cooney2015] [@Takaza2013])

  • ‘National Institute of Health (R01EB024531-01) presently’ — start with "and" as it's the last in the list.

Octave compatibility

Hello Kevin,
Does GIBBON work/compile with Octave?
I've recently created a fork and git cloned into my laptop. I'm using Octave 4.2.2.
I get the following error message, complaining that groot cannot be found.
>> installGibbon error: 'groot' undefined near line 14 column 15 error: called from installGibbon at line 14 column 14

DEMO_FEBio_multigen_interface_active

I do the merging of three meshes (Object1, Object2, Object3) based on example of multigen_interface_active. After, I want to allocate the volume mesh to Object 2 not touching Object 1 and Object 2 which will be in future the rigid bodies. What am I doing wrong?
STL files.zip


%File names
fileName=fullfile(pathName,'Object1stl');
[stlStruct] = import_STL(fileName); 
FL=stlStruct.solidFaces{1};
VL=stlStruct.solidVertices{1};
[FL,VL]=mergeVertices(FL,VL);

fileName=fullfile(pathName,'Object2.stl');
[stlStruct] = import_STL(fileName); 
F_tet1=stlStruct.solidFaces{1};
V_tet1=stlStruct.solidVertices{1};
[F_tet1,V_tet1]=mergeVertices(F_tet1,V_tet1);

fileName=fullfile(pathName,'Object3.stl');
[stlStruct] = import_STL(fileName); 
FS=stlStruct.solidFaces{1};
VS=stlStruct.solidVertices{1};
[FS,VS]=mergeVertices(FS,VS);

%% Joining and merging geometry sets
%Joining sets 
%Creating color information
CL1=1*ones(size(FL,1),1); %Object1
Ctet1=2*ones(size(F_tet1,1),1); %Object2
CS1=3*ones(size(FS,1),1); %Object3

[F,V,C]=joinElementSets({FL,F_tet1,FS},{VL,V_tet1,VS},{CL1,Ctet1,CS1}); %joining sets together

%merging sets
[F,V]=mergeVertices(F,V);

%% Find solid mesh region interior points
logicRegion=ismember(C,[2]);
[V_in_1]=mean(V_tet,1);%getInnerPoint(F(logicRegion,:),V);
V_regions=[V_in_1];
%%
cFigure;
xlabel('X','FontSize',fontSize); ylabel('Y','FontSize',fontSize); zlabel('Z','FontSize',fontSize)
hold on;

gpatch(F,V,C,'none',0.5);
%patchNormPlot(F,V);
plotV(V_in_1,'r.','MarkerSize',60);

axisGeom; 
colormap(plotColors); icolorbar;
drawnow; 

%% Mesh solid using tetgen
% Create tetgen meshing input structure
modelName=fullfile(pathName_s,'tempModel');

% Regional mesh volume parameter
[regionA]=tetVolMeanEst(F,V); %Volume for a regular tet based on edge lengths
volumeFactors=(regionA.*ones(size(V_regions,1),1));

inputStruct.stringOpt='-pq1.2AaY';
%inputStruct.stringOpt='-d';
inputStruct.Faces=F;
inputStruct.Nodes=V;
inputStruct.holePoints=[];
inputStruct.faceBoundaryMarker=C; %Face boundary markers
inputStruct.regionPoints=V_regions; %region points
inputStruct.regionA=volumeFactors; %Desired volume for tets
inputStruct.minRegionMarker=2; %Minimum region marker
inputStruct.modelName=modelName;
%% 
% Mesh model using tetrahedral elements using tetGen (see:
% <http://wias-berlin.de/software/tetgen/>)
[meshOutput]=runTetGen(inputStruct); %Run tetGen 

%% Visualizing mesh
meshView(meshOutput);
% 

Inject Nodal forces into the .feb file

Hello,

I'm trying to inject some forces into FEBio as Nodal loads Via the Febiostruct2xml function. The forces that I calculate saparetly, are applied to nodes w.r.t. the direction of the normals of my tetraedre elements.

Do you have any ideas what do that ?

Thanks,
Cheers

Amine

How can I take the output of the current time step including fiber orientation and fiber stress without the stress from the neo-Hookean basis and use them to impose as the boundary condition, nodal body force or element centroid force at the next time?

I'm modeling the tissue mechanics with compressible neo-Hookean and exponential fibers distributed anisotropically by assigning each fiber orientation in the begining in the order of the elment number.
What I want to do is to update the
element centroid forces as external force at the next time step as a function of
fiber orientation, , , , fiber stiffness, , and fiber stretch at the current time step
by my user-made solver using the output stress and fiber orientation at the current step as input. And then feedback from my solver the boundary condition, nodal body force or element centroid force at the next time step and solve the next time step continuously until the end time step is reached.
How can I take the output of the current time step including fiber orientation and fiber stress without the stress from the neo-Hookean basis and use them to impose as the boundary condition, nodal body force or element centroid force at the next time? Should I make a plugin for that or there is a way to do that in MATLAB with the help of GIBBON?

Stitching 2 surfaces together

Hello Kevin,

I am trying to use delaunayZip function to stitch 2 surfaces together along their edge. It fails with following message:

`Operands to the || and && operators must be convertible to logical scalar values.

Error in delaunayZip (line 226)
if indClosest~=1 && indClosest~=numel(indListSub2)

Error in STEP1 (line 202)
[F,V,C]=delaunayZip(F_SLIL_Lunate,V_SLIL_Lunate,F_SLIL_Scaphoid,V_SLIL_Scaphoid,inputStruct);`

What does it mean?

suggest a small change to patchNormPlot

If the input vertices include NaNs, no arrows will plot unless "a" is given as input.
I suggest a very quick and easy fix: replace "mean" in line 83 with "nanmean".

Fix remeshTriSurfDistMap to work on non MS Windows systems

remeshTriSurfDistMap (see also DEMO_geodesic_remeshing) does not run in Ubuntu. Currently the error says:
Error using perform_fast_marching_mesh (line 66) You have to run compiler_mex before.
However I've not been able to compile it on Ubuntu.

There is two anim8 toolbar when I reload a .fig

Hi,
Following #41, Thank you for adding this functionality this is very useful.
Nevertheless, I have to report a minor bug on the function.

There is two anim8 toolbar when I reload a .fig
image

The problem might be at the line 91

hb = findall(hf,'Tag',toolbarTag); % hb = findall(hf,'Type','uitoolbar');
if ~isempty(hb) 
    delete(hb)
end

Also, the loading is very nice but I'm not able to enjoy the features of cFigure.
Is possible to develop an opencFigure.m-like function ?

Kind regards,

Pierre

Translation of MATLAB codes to JULIA

JULIA is an open source language which can outperform MATLAB on many fronts. Translation would be a significant effort but it can make the toolbox "truely open". My main worry at the moment is 1) GUI building and segmentation, 2) easy 3D visualization (lacking in most libraries). I will have to explore these to learn if switching to JULIA is feasible.

testGibbon - error results in termination

@Kevin-Mattheus-Moerman openjournals/joss-reviews#506
The first encountered error when running:
testGibbon('demo', 'test');
Terminates the rest of the testing. Ideally, these errors would be trapped and recorded, but testing could continue.

Specifically, this occurs with:

testGibbon -> Test file:14 of 58 DEMO_FEBio_block_biaxial_loading_stiffness_analysis.m

Yielding the trace:

Error using -
Matrix dimensions must agree.

Error in patchDetach (line 12)
FX=((FX-FX_mean)*shrinkFactor)+FX_mean;

Error in ind2patch (line 59)
[F,V]=patchDetach(F,V,1);

Error in viewFourthOrderTensor (line 133)
[Fp,Vp,Cp]=ind2patch(logicEntry,CM,'sk');

Error in DEMO_FEBio_block_biaxial_loading_stiffness_analysis (line 286)
viewFourthOrderTensor(c); %Visualize tensor C

Error in run (line 96)
evalin('caller', [script ';']);

Error in testGibbon (line 71)
run(mFileNow);

Update website to "welcome" new users

The website should be more inviting to potential new collaborators. Perhaps a "For developers" section can be written to instruct new users on how to contribute in more detail.

Improve XML file handling, update to latest FEBio and febio_spec 2.5

The latest FEBio version offers many new features. Some require the febio_spec 2.5 format. Currently GIBBON is coded based on febio_spec 2.0. It would be good to update to 2.5.
In parallel the feb file (XML file) handling is difficult to expand and involves many dedicated functions. It would be better to have a single clean function to handle XML file generation which can cope with arbitrary XML components (and is therefore compatible with any febio_spec).

Errors using vcw

Struct contents reference from a non-struct array object.

Error in matlab.uitools.internal.uimode/modeWindowButtonUpFcn (line 12)
appdata.numButtonsDown = appdata.numButtonsDown - 1;

Error in matlab.uitools.internal.uimode/setCallbackFcn>localModeWindowButtonUpFcn (line 56)
hThis.modeWindowButtonUpFcn(hFig,evd,hThis,newButtonUpFcn);
 
Error while evaluating Figure WindowButtonUpFcn.

and

Not enough input arguments.

Error in vcw>scroll (line 612)
    cax = get(hf, 'CurrentAxes');

Error while evaluating Figure WindowScrollWheelFcn.

negative jacobians in DEMO_febio_0044_mammography_01

Dear Kevin,
I'm trying to get the mammography DEMO file to run but keep running into negative jacobians. I tried varying the material parameters (c,m,k) but with no success. The plates seem to be penetrating the surface. Could the problem be with the contact penalty or gap tolerance? I am using:
Matlab 2017B
Macos 10.14.6
FEBio 2.9.1
many thanks for any help you could offer, André

Indentation on biphasic slab and the coupling hydropermiability does not work

Hi contributers of Gibbon,

I want to simulate spherical indentation on a biphasic slab. I tried to combine DEMO_0006 and DEMO_0018 to achieve this, so I add the biphasic properties from 0018 into 0006. However, I plot the Cauchy stress-time plot and tested many different permHydro values and found it doesn't change the plot, which means the biphasic properties do not work out.
I have no idea how to modify this. I think somewhere is wrong in line 246- 263.
I attach my code, could anyone have experience in FEBio provide me suggestions?

Sorry I think the problem is basically from my unfamiliarity with Gibbon code for FEBio input. I appreciate for your suggestions on any link to the code introduction.

Thank you very much. Any suggestion is appreciated!

Best,
Yin

Yin_febio_biphase_sphere_indentation.txt

Indicate Matlab Version and OS tested

This issue replaces #507 raised by @siboles

I've installed in R2015a Matlab on Arch Linux. It seems your Linux testing is on an Ubuntu machine, which is probably the best choice for the widest audience. Most things went smoothly, although the help did not integrate for me. I'm not sure if it is my Matlab version, how I installed on Arch, or something else. My Matlab skills are not the greatest.
I would however, indicate somewhere in the paper.md or the README what Matlab Version you've tested on, or if a minimum version is known, and also the Linux OS, and the minimum Windows version.

Update FEBio demos with control settings

Add something like the following to the control parameter sections in all FEBio demos:

%FEA control settings
nSteps=20; %Number of time steps desired
max_refs=25; %Max reforms
max_ups=0; %Set to zero to use full-Newton iterations
opt_iter=10; %Optimum number of iterations
max_retries=5; %Maximum number of retires
dtmin=(1/nSteps)/100; %Minimum time step size
dtmax=1/nSteps; %Maximum time step size

This creates an improved visibility of the control parameters but also enables switching to full-newton iterations for the demos (by using max_ups=0). Doing so will improve consistency across platforms/FEBio versions (as mentioned in #12).

How to remesh at each step?

Hi, I'm trying to replicate the model of cell mitosis of contraction of the cleavage furrow in this paper
https://peerj.com/articles/1490/
And the model I mention is this
https://dfzljdn9uc3pi.cloudfront.net/2015/1490/1/fig-4-2x.jpg
I construct a solid sphere and use the neo-Hookean material with poisson ratio 0.49 to serve as nearly incompressible material. However, when I tried to contract the central equatorial furrow region (central band), I can hardly get the convergent result as the shrinkage of radius goes up. Is there a way to do the remesh at each step with the help of Gibbon?

Installation error

Hello, I just downloaded the last gibbon update from the oficial site. I uploaded all the files to my server and when I try to run the wizard I get this error.

Parse error: syntax error, unexpected '?' in /src/Services/CoreServiceProvider.php on line 174

Import febio_spec 2.5 and export .inp files

Hi, recently I wan to import the .feb with named selection and parts from the export of Preview, but I found that both
"Help_import.feb" and "DEMO_import_FEB_export_INP" do not support febio_spec 2.5.
Could you add this to the Gibbon codes?

anim8.m plays the vizualisation slower than the choosen speed.

Hi,

I tried to use your useful anim8 tool to vizualise my musculoskeletal simulation of CusToM. I used it on Matlab 2018a, on a Windows 10 with the following config:
image

However the function is not playing the simulation at real speed. Do you have any idea how to do it ?

One of my explanation is that the animStruct is too large to be handle by the anim8.m function.

tuto2_muscleforce

Here it is the link with a zip of the figure and the animStruct.
Best regards,

Pierre

The anisotropy from fiber direction doesn't work for "DEMO_febio_0015_cube_fibers_transiso"

Hi, recently I am trying to build a model by modifying the "DEMO_febio_0015_cube_fibers_transiso"
But when I change the "alpha" of the angle of fiber orientation from 1/3 pi to 1/2 pi and 0, The stress-strain curve always stay the same with the stress equals to -0.006718... Is there anything wrong with the fiber setting in the model. Please help and let me know how to fix it, thanks!

Make VCW compatible with axis windows in uitab environments

Currently VCW does not work for these types of axes:

[X,Y,Z]=peaks(25); %Create some patch data

hf = cFigure; %Open a figure with the VCW widget pre-loaded
%axis

tabgp = uitabgroup(hf); %Start a tab group

%Tab 1
tab1 = uitab(tabgp,'Title','A surface in tab 1'); %Add tab 1
axes(tab1);
surf(X,Y,Z);
axis tight; axis equal; 

%Tab 2
tab2 = uitab(tabgp,'Title','A surface in tab 2'); %Add tab 1
axes(tab2);
surf(X,Y,Z);
axis tight; axis equal; 

tetGen meshing: 'The 1-th region point lies outside the convex hull'

Hello,

While running tetGen with inputStruct of my STL, I get this error:
Warning: The 1-th region point lies outside the convex hull. "/Users/s2986149/Desktop/GIBBON/lib_ext/tetGen/mac64/tetgen" -pq1.2AaY "/Users/s2986149/Desktop/GIBBON/data/temp/tetgenmodel.smesh": Segmentation fault --- Done --- 08-Feb-2019 14:58:06 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --- Importing TetGen files --- 08-Feb-2019 14:58:06 Warning: /Users/s2986149/Desktop/GIBBON/data/temp/tetgenmodel.1.node import unsuccesful

What can cause this?

Thanks in advance,
NataCalc

Scaphoid_improved_surface.stl.zip
tetGen_mesh_sizing_function_Scaphoid_Lunate.m.zip

How to define more than 1 set of mat_axis on each element with fibers

Hi, I'm trying to simulate biaxial extension of orthotropic material matrix with exponential-power law fiber distributed in random direction. When I try the compressible neo-Hookean material with fibers by modifying the DEMO_febio_0015_cube_fibers_transiso, it works. However, when I switch to 'Fung-ortho-compressible' material matrix and assign
febio_spec.Material.material{1}.mat_axis.ATTR.type='vector';
febio_spec.Material.material{1}.mat_axis.a=[1 0 0];
febio_spec.Material.material{1}.mat_axis.d=[0 1 0];
, I cannot run the simulation. I've check the usermanual of solid mixture but I didn't see any part that preventing this to work. I'm wondering how to set multiple mat_axis's on each element because my fianl goal is to have two kinds of fibers at each orthogonal element. I need triple mat_axis's on each element.
I'd like to know how to do that with GIBBON, thanks.

febioStruct2xml

Hello,

I have recently installed GIBBON code onto a different pc and found my existing code did not work, realized some information in the output xml file differs from input FEB struct.

As one example from my code, in Matlab the input FEB struct was,

FEB_struct.febio_spec.Contact.contact{1, 1}.surface{1, 1}.tri3
ans =
struct with fields:
VAL: ' 1, 3, 2'
ATTR: [1×1 struct]

FEB_struct.febio_spec.Contact.contact{1, 1}.surface{1, 1}.tri3.ATTR.id
ans =
'1'

which outputs .feb file as in:

      <tri3 id="49">32, 32, 32, 32, 32, 49, 44, 32, 32, 32, 32, 32, 51, 44, 32, 32, 32, 32, 32, 50</tri3>

When I changed back to febioStruct2xml from my older pc, this issue did not occur.

Thank you!

history of training request...

Kevin,

can you please post the ENTIRE Matlab "history" that you generated from your Workshop at CMBBE? you can post it line for line with errors/etc -- thats fine.

if you don't want to put it here - please send it to me via email.
thanks,
jonathan vande geest
university of Pittsburgh

Running Gibbon on unix cluster

Hi,
I am trying to run gibbon on unix supercomputers and I am getting the error below about permission.
/bin/bash: /ihome/jvandegeest/hik27/CSMMD_CRC_job_submission_template/geometry/GIBBON-master/lib_ext/tetGen/lin64/tetgen: Permission denied
I tried changing the permission of the GIBBON-master folder but that didn't resolve the issue. Please advise.
I also attached the file below.

Thanks,
hirut
error.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.