== Fiber Angle Fit == [[Gallery]] [[TableOfContents(3)]] === Description === * These step-by-step instructions will guide you through fitting fibers' orientation data in 2D space (on a plane) * Fiber is an important structure of cardiac muscle which plays a critical role in cardiac muscle properties. [[BR]] Therefore, the heart model will be realistic if it has fiber data. * The concept of fiber fitting is to put the initial value of fiber angle (in radian) which should specifically refer from Xi(1) or Xi(2) direction * An automated script that runs this tutorial is included in the Continuity installation: `\examples\data02\cubic_fib_fitting.py`. To run it, click [:Continuity/Documentation/Help/ReadPythonScript:File→Read script→Python or session script] === Start Continuity === * Launch the Continuity Client * On the [:Continuity/Documentation/Help/HelpAboutContinuity:About Continuity startup screen] * check the '''fitting''' box under {{{Use Modules:}}} * Click '''OK''' to bring up the main window === Set up mesh === * [:Continuity/Documentation/Help/MeshEditCoordinates:Mesh→Edit→Coordinates...] * Select '''rectangular cartesian''' in the {{{Global Coordinates:}}} pop-up menu * Click '''OK''' to submit {{{Coordinate Form}}} * [:Continuity/Documentation/Help/MeshEditBasis:Mesh→Edit→Basis...] * Choose '''Lagrange Basis Function→2D→Linear-Linear''' * Click '''Add''' * Choose '''Hermite Basis Function→2D→Cubic-Cubic''' * Click '''Add''' * Verify that the list of basis functions now contains: * Linear-Linear Lagrange 3*3 * Cubic-Cubic Hermite 3*3 * Click '''OK''' to submit {{{Basis Form}}} * [:Continuity/Documentation/Help/MeshEditNodes:Mesh→Edit→Nodes...] * Click '''Import/Export/Graph''' button to open [:Continuity/Documentation/Help/TableManager:Continuity Table Manager] * [:Continuity/Documentation/Help/TableManager#FileMenu:Continuity Table Manager→File→Open...] * Select tab-delimited nodes file ( attachment:nodes.xls ) * [:Continuity/Documentation/Help/TableManager#FileMenu:Continuity Table Manager→File→Close and update form] * You should now have nodes numbered 1-25 * Click on the {{{Field Vector 1}}} tab * Select '''Cubic-Cubic''' under {{{Field Variable 1}}} * Click on the {{{Fiber Angle}}} tab * Select '''Cubic-Cubic''' under {{{Fiber Angle}}}, {{{Transverse Angle}}}, and {{{Sheet Angle}}} * Click '''OK''' to submit {{{Node Form}}} * [:Continuity/Documentation/Help/MeshEditElements:Mesh→Edit→Elements...] * Click '''Import/Export''' button to open [:Continuity/Documentation/Help/TableManager:Continuity Table Manager] * [:Continuity/Documentation/Help/TableManager#FileMenu:Continuity Table Manager→File→Open...] * Select tab-delimited elements file ( attachment:elems.xls ) * [:Continuity/Documentation/Help/TableManager#FileMenu:Continuity Table Manager→File→Close and update form] * You should have 16 elements in the list * Click '''OK''' to submit {{{Element Form}}} * [:Continuity/Documentation/Help/MeshRenderElements:Mesh→Render→Elements...] * Click the '''lines''' radio button * Click '''Render''' * [:Continuity/Documentation/Help/MeshEditMaterialCoordinates:Mesh→Edit→Material Coordinates...] * Click on the '''OK''' Button * [:Continuity/Documentation/Help/FileSend:File→Send] * [:Continuity/Documentation/Help/MeshRenderFibers:Mesh→Render→Fibers...] * Leave default settings and click '''OK''' * The mesh should now look similar to the first screenshot above === Set up fitting === * If the {{{Fitting}}} menu is not loaded, select [:Continuity/Documentation/Help/FileLoadModule:File→Load Continuity Modules...] * Select '''fitting''' and click '''OK''' * The menu bar should now show the Fitting command * [:Continuity/Documentation/Help/FittingEditData:Fitting→Edit→Data...] * Click '''Import/Export/Graph''' button to open [:Continuity/Documentation/Help/TableManager:Continuity Table Manager] * [:Continuity/Documentation/Help/TableManager#FileMenu:Continuity Table Manager→File→Open...] * Select tab-delimited data file ( attachment:data.xls ) * [:Continuity/Documentation/Help/TableManager#FileMenu:Continuity Table Manager→File→Close and update form] * You should now have Data numbered 11-169 * Click '''OK''' to submit {{{Data Form}}} * [:Continuity/Documentation/Help/FittingEditData:Fitting→Edit→Fit Weights...] * Simply click '''OK''' after opening the {{{Weights}}} form * [:Continuity/Documentation/Help/FittingEditData:Fitting→Edit→Fit Constraints...] * Simply click '''OK''' after opening the {{{Constraints}}} form * [:Continuity/Documentation/Help/FileSend:File→Send] * [:Continuity/Documentation/Help/MeshCalculateMesh:Mesh→Calculate Mesh...] * [:Continuity/Documentation/Help/FittingFitData:Fitting→Fit Data] * In the `Cooridinates` tab, select '''coord_1''', '''coord_2''', '''coord_3''' for the three coordinates * In the '''Fibers''' tab, select `field1_Var1` for '''Fiber Angle''' * In the `Fitting Variables` tab, *deselect* '''Coordinate 1''', '''Coordinate 2''', '''Coordinate 3''', and '''Fiber Angle''' * Click the '''Fit''' button (Don't close the Fit Data form yet) * [:Continuity/Documentation/Help/FittingCalculateDataXi:Fitting→Render→Raw data...] * Go back to the `Fit Data` form. In the `Fitting Variables` tab, check only the '''Fiber Angle''' checkbox * Click the '''Fit''' button * [:Continuity/Documentation/Help/MeshRenderFibers:Mesh→Render→Fibers...] (Note: you should render '''mesh''' fibers, not fitting fibers) * Leave the default values and click '''OK''' * [:Continuity/Documentation/Help/ViewShowOpenMesh:View→Show Open Mesh...] * Click on '''fiber vectors4''' in the list on the left * Click on the {{{Colors}}} tab * Change the {{{R,G,B}}} color field to '''1,0,0''' to change the color to the brightest red * Click on '''data vectors3''' in the list on the left * Change the {{{R,G,B}}} color field to '''0,1,0''' to change the color to the brightest green * Click somewhere in the rendered window to refresh the image * The mesh should now look similar to the second screenshot above === Pre-built model === This cont6 file contains all data and parameters for this problem: attachment:fit3.cont6