{"id":20391387,"url":"https://github.com/insigneo/microfe","last_synced_at":"2025-03-05T00:16:16.250Z","repository":{"id":74056220,"uuid":"96780197","full_name":"INSIGNEO/microFE","owner":"INSIGNEO","description":null,"archived":false,"fork":false,"pushed_at":"2018-08-16T10:29:11.000Z","size":6479,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-02T04:35:30.408Z","etag":null,"topics":["finite-elements","mesh-generation"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/INSIGNEO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-07-10T13:24:04.000Z","updated_at":"2018-08-16T10:29:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc54e1e2-12e3-4c03-8fea-e3bf5fde75a7","html_url":"https://github.com/INSIGNEO/microFE","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INSIGNEO%2FmicroFE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INSIGNEO%2FmicroFE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INSIGNEO%2FmicroFE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INSIGNEO%2FmicroFE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/INSIGNEO","download_url":"https://codeload.github.com/INSIGNEO/microFE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241940575,"owners_count":20045883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["finite-elements","mesh-generation"],"created_at":"2024-11-15T03:32:18.390Z","updated_at":"2025-03-05T00:16:16.227Z","avatar_url":"https://github.com/INSIGNEO.png","language":"Jupyter Notebook","readme":"# microFE\n\n[![TUoS](https://img.shields.io/badge/-The%20University%20of%20Sheffield-blue.svg?colorA=ffffff\u0026colorB=009fe3\u0026logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAABsFBMVEUAAABmZplVVYBLPHheUYZJPXlSR3pCOnNgWIdoYI9FPnVMQXc0JGM0KmhEOXI0MW8xMW2Ph6yYkrOWj6%2BOiayinLqWkbIcWJkdWJezrsW2sciclrWmoL0cWpkbXJuCfqQVba4Vba2tqsKBgKWXkbGgm7ioo7%2Bln7umobyppcClob0RdrgSd7ikoLuXkbEeeKwieqmYkrKkn7sAneAAn%2BMBnN8Dn%2BIEj9IEkNQEoOMFi88GicwHnuAInuAVaqkVgrEWa6sWiskYj84ek88mk8wmqOInqOIqhrA4qd45qd87kaA8q988q%2BA9qN0%2Fk51Aqd1CqdxCqd1JnqtNnc9OnKVPnItSmsZUmqZVlsFVnYZVns1bst9ds99ftN9isNtitN9joa1msdtnveZqoaRqrNZqvuZsrdZvk2lylWR0nKZ2oJx%2BfKOBf6WEn5eGr3iIr3eduNWfmbifmrifudWim6mjnKmloLymrz2psTuuqb6uqsOwq8C0taG2tqS4tqy4tra6uTC6ui6%2FsCK%2FsCPBvdHDv9LFwtfGwtjOy9rPzdvUlaHmkpb%2B%2FPz%2B%2Fv7%2F%2FPz%2F%2F%2F9OZpcfAAAAM3RSTlMABQYRExUZHyAgJS8xMTFTVFleZmiJkpOTmp2oqba9wsTFxcfO0dPX3OLj5%2Bf19v39%2Fv4kncL4AAAAvElEQVR4AWNgYBIQV9Q20NdRkOBnZGBg4DExTQ9taIzMMDbhA3PdzMqbmyosXaHc4kCvvHy%2FgAIINzElvL%2B%2FvzcoLQ7E5bX1TOhq624P8bDhBnLZTEwye%2Fr7%2BpNNTFgYgMApJreuprY%2BK94RyOGSlEv19XZx9vFPkpViZ1BRZ7WKdq%2Bsto%2B1ZtZQYhAp1FS2iCopDTaX1yoSZmDgkNHrsAuLcOjUleZkAAGxqtbsnJYyUQYoEFIzMlQVBLEA%2FZgsl9iPrB4AAAAASUVORK5CYII%3D)](https://www.sheffield.ac.uk)\n[![INSIGNEO](https://img.shields.io/badge/-INSIGNEO-red.svg?colorA=ffffff\u0026colorB=cf2020\u0026logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAABC1BMVEUAAAD%2FAAC%2FAADMGhrRFxfSHh7VHBzJGxvTISHKICDMHx%2FOHR3RJCTTIyPOISHPICDMHR3NIyPNICDRISHQHx%2FQHx%2FOHx%2FQISHOICDQICDQHx%2FOHx%2FPISHQISHQICDOICDQISHOICDQICDPISHPICDQISHPICDPICDOHx%2FPISHPISHQISHPICDPISHPISHQICDOICDOICDPHx%2FPICDPICDOICDPICDPICDPICDPHx%2FPICDPICDQICDPICDPHx%2FQISHOICDPICDPICDPICDPICDPHx%2FMISHOICDPICDQICDPICDPISHPHx%2FPICDPICDPICDPICDPICDPICDOICDPHx%2FPICDPICDPICDPICDi8V76AAAAWHRSTlMAAgQKCxESExcYGRocHR8gIyRITVFSU1ZYYWJjZGZnaWxucXV5fH%2BAg4SFjI%2BUlZeYqKuusbK2ubrDxcbHycvMzdHU2Nrb4uLl5%2Bnq6%2Bzt7u%2F09vf7%2FP3%2B%2FHERCQAAAKVJREFUeAEdx%2BVCg2AAhtHHAANDMQRD7ECwO7DDjViM7b3%2FK9n4zr9Dxdk6jjc4s02si46kK7tMLGDuW%2Fq%2FvdxZlt5shh7VWhsGTqWvTVYll0q4PjMyy7VuYHQ7nIL98oVMAey183sI9EtNPpzXfz7BV8aHIpi%2Fe3ch1iuHysYxnFxHTDf1bD7xpMKBxa6Kk6WVKFXPY8BLZTQWMMYOHvK%2FZHcS6AOapR0V%2FpSSVQAAAABJRU5ErkJggg%3D%3D)](https://insigneo.org/)\n[![CompBioMed](https://img.shields.io/badge/-CompBioMed-yellow.svg?colorA=grey\u0026colorB=f4b540\u0026logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAAoAAAAQCAMAAAAYoR5yAAAA81BMVEUAAAD%2F%2F%2F%2Bqqqr%2F%2F8z%2FzLP%2FyKT%2F1ar%2F4KP%2F9dj%2F5L%2Fm1bP%2F3bv%2Fx4Dw4eHbzJn%2F26%2F52Zn%2FzobQypT%2F6LveyLH%2FyID63d3%2F05P%2Fx3nt19fZzbT%2Fv2Dx0sHk0NDPtX7%2Fxln207D53abEr3f8vFjx1Jz%2FxWP%2FvmL%2FwWT%2Fw0f8vk7t0aj12aLBsnzz0qbTvZritmTAq3vWtF6%2FrIHHr4rJsor6vGPYu3vCsIft17rewJLCq3nw267KtYn%2Fv1vKtJL%2FvFPzz5v547H536P9uE%2FLrG7LsnHGsHbyvmXexIzWq130qkP3y3%2F8tUr3yYD6s0T8sz78tETsoiaWAAAAUXRSTlMAAgMFCg4YGRocHh4gIiMjKCorLS4uNDQ3OT1ISkxPUFFTVldYXV5eYWJkZWdnaGlqamttbW9wcXN1dnh5e35%2Bf3%2BAgYSFio6Sl5ydn6GkqK2fR9KlAAAAd0lEQVQI1zXGRQKCABRAwWdhY3d3t9iJ3d7%2FNC74zmo4H%2FH4AGBxoWIzetKUnDFu321c2vtUrdLx0y5j8oj9u3sPzFL9Ps9K86%2FmSho5FK77sgmglGKamLUA6gH6rkzHDzTcBDfe6BJYO6A4DKdDFmpOQG2PuskfKZ4MqTH%2F64gAAAAASUVORK5CYII%3D)](http://www.compbiomed.eu/)\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## Installation (ShARC)\n\nLog in and create conda environment\n\n```bash\n$ qrshx\n$ module load apps/python/conda\n$ cd \u003cpath to\u003e/microFE/\n$ conda env create -f environment.yml\n```\n\nCompile matlab code as\n\n```bash\n$ cd m_files/\n$ module load apps/matlab/R2016a\n$ ./compile.sh\n```\n\nIn case you want to run the workflow in Windows, compile `m_files/main_win.m` file.\n\n## Usage\n\nThe entire pipeline is run by\n\n```bash\n$ python microFE.py -c config.ini\n```\n\nwhere `config.ini` is a generic configuration file. Meshing and FE solver are run by submitting a batch job. See `microFE.sh` for an example file which you can run as `qsub microFE.sh` in ShARC. All the parameters are specified in the `.ini` configuration file.\n\n### Configuration file\n\nThe meshing process requires the definition of a number of paths and variables. These are defined in a `.ini` configuration file\n\n```\n[directories]\nCT_IMAGE_FOLDER = \u003cCT image location\u003e\nOUTPUT_DIR = \u003coutput folder path\u003e\nMESHER_SRC = \u003cfolder containing the compiled matlab code\u003e\nLD_LIB_PATH = \u003cmatlab executable path, $LD_LIBRARY_PATH on ShARC\u003e\n\n[images]\nimg_name = \u003cmicroCT DICOM image name\u003e\n\n[mesher]\nthreshold = \u003cbone tissue threshold in uCT images, e.g., 18500\u003e\nresolution = \u003cvoxel size in uCT images in micron, e.g., 19.96\u003e\n\n[fem]\nboundary_condition = \u003c`displacement` or `load`\u003e\nunits = \u003c`mm` or `percent` for `displacement`, `N` for `load`\u003e\ndirection = \u003c`x`, `y`, or `z`\u003e\nsign = \u003c`positive` or `negative`\u003e\namount = \u003cdiplacement or load amount; float\u003e\nconstrain = \u003c`full` or `free`\u003e\nE = \u003cYoung's modulus in Pa; float\u003e\nyield_stress = \u003cyield stress value in Pa - only for plastic-elastic model; float\u003e\nEt = \u003ctangent Young's modulus in Pa - only for plastic-elastic model; float\u003e\n\n[job]\nname = \u003cjob name\u003e\nnp = \u003cnumber of processes\u003e\n```\nThe element used in ANSYS APDL is the 8-nodes [SOLID185](https://www.sharcnet.ca/Software/Ansys/16.2.3/en-us/help/ans_elem/Hlp_E_SOLID185.html)\n\u003cdiv style=\"text-align:center\"\u003e\u003cimg src =\"https://www.sharcnet.ca/Software/Ansys/16.2.3/en-us/help/ans_elem/graphics/gELEM185-1.svg\" /\u003e\u003c/div\u003e\n\nBy specifying only the Young's modulus `E`, the analysis will be [linear elastic](https://www.sharcnet.ca/Software/Ansys/16.2.3/en-us/help/ans_mat/ann8sq39eldm.html#ELlinmatstressstrain), whereas including also `yield_stress` and `Et` (the tangent Young's modulus) the analysis will be [elastic-perfectly-plastic](https://www.sharcnet.ca/Software/Ansys/16.2.3/en-us/help/ans_mat/amp8sq21dldm.html#miso).\n\n## Matlab mesher\n\nIn `m_files\\` there is the code for generating FE models with cartesian mesh and homogeneous material properties. The original mesher code is in `/m_files/mesher.m`.\n\nThe following inputs are required:\n\n- greyscale images (`.tiff` format);\n- voxel size (`Image_Resolution`);\n- threshold for defining bone tissue;\n\nThe `m_files/main.m` file executes the mesher.\n\nThe script in `m_files/compile.sh` compiles the matlab scripts with the matlab compiler. Compiled files can be run with the matlab runtime environment.\n\n## Outputs\n\nAfter executing microFE.py, the results will be saved in `OUTPUT_DIR/` folder as specified in the `.ini` configuration file. The folder structure will be\n\n```\n\u003cOUTPUT_DIR\u003e/\n  |- elementdata.txt          (mesh elements list)\n  |- nodedata.txt             (mesh nodes list)\n  |- fe_model.txt             (Ansys model script)\n  |- microFE.py.log           (log file)\n  |- Binary/                  (Binary slices from microCT image)\n  |   |- binary0001.tif\n  |   |- binary0002.tif\n  |   |- ...\n  |- tiff/                    (microCT slices converted to tiff from DICOM)\n  |   |- \u003cimg_name\u003e_0001.tif\n  |   |- \u003cimg_name\u003e_0002.tif\n  |   |- ...\n  |- NodalDisplacements.txt   (nodal displacement from FEM solution as: node, x, y, z)\n  |- \u003cjob_name\u003e.db            (Ansys output files)\n  |- \u003cjob_name\u003e.err\n  |- \u003cjob_name\u003e.esav\n  |- \u003cjob_name\u003e.log\n  |- \u003cjob_name\u003e.mntr\n  |- \u003cjob_name\u003e.PCS\n  |- \u003cjob_name\u003e.rst\n  |- \u003cjob_name\u003e.stat\n```\n\n## Citation\n\nThe Matlab code was developed by Y. Chen as part of his PhD project:\n\n- _Chen Y, Pani M, Taddei F, Mazzà C, Li X, Viceconti M. [Large-scale finite element analysis of human cancellous bone tissue micro computer tomography data: a convergence study](http://biomechanical.asmedigitalcollection.asme.org/article.aspx?articleid=1892759). Journal of biomechanical engineering. 2014 Oct 1;136(10):101013._\n\n- _Chen Y, Dall'Ara E, Sales E, Manda K, Wallace R, Pankaj P, Viceconti M. [Micro-CT based finite element models of cancellous bone predict accurately displacement once the boundary condition is well replicated: A validation study](http://www.sciencedirect.com/science/article/pii/S1751616116303204). Journal of the mechanical behavior of biomedical materials. 2017 Jan 31;65:644-51._\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsigneo%2Fmicrofe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsigneo%2Fmicrofe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsigneo%2Fmicrofe/lists"}