Skip to content

Commit

Permalink
Merge pull request #55 from mlin865/pigColon
Browse files Browse the repository at this point in the history
Pig colon
  • Loading branch information
rchristie authored Jul 6, 2019
2 parents 212caff + 5ae192d commit 82d8e93
Show file tree
Hide file tree
Showing 2 changed files with 229 additions and 117 deletions.
66 changes: 63 additions & 3 deletions scaffoldmaker/meshtypes/meshtype_3d_colon1.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,59 @@ class MeshType_3d_colon1(Scaffold_base):
[ [ 0.1, -1.0, -0.7 ], [ -0.3, -0.7, 0.4 ], [ 0.0, 0.0, 0.5 ], [ 0.0, 0.0, 0.05 ] ],
[ [ -0.4, -2.3, -0.1 ], [ -0.4, -0.6, 0.3 ], [ 0.0, 0.0, 0.5 ], [ 0.0, 0.0, 0.05 ] ] ] )
} ),
'Pig 1' : ScaffoldPackage(MeshType_1d_path1, {
'scaffoldSettings' : {
'Coordinate dimensions' : 3,
'Length' : 1.0,
'Number of elements' : 43
},
'meshEdits' : zinc_utils.exnodeStringFromNodeValues(
[ Node.VALUE_LABEL_VALUE, Node.VALUE_LABEL_D_DS1, Node.VALUE_LABEL_D_DS2, Node.VALUE_LABEL_D2_DS1DS2 ], [
[ [ 8.1, 2.4, 5.1 ], [ -1.5, 0.6, -3.4 ], [ 0.0, 0.0, 0.5 ], [ 0.0, 0.0, 0.05 ] ],
[ [ 6.2, 3.0, 1.8 ], [ -3.0, 0.6, -2.3 ], [ 0.0, 0.0, 0.5 ], [ 0.0, 0.0, 0.05 ] ],
[ [ 2.2, 3.6, 0.5 ], [ -5.5, 1.0, -0.6 ], [ 0.0, 0.0, 0.5 ], [ 0.0, 0.0, 0.05 ] ],
[ [ -2.0, 3.5, 0.8 ], [ -3.6, -2.1, 0.4 ], [ 0.0, 0.0, 0.5 ], [ 0.0, 0.0, 0.05 ] ],
[ [ -4.0, 0.0, 1.3 ], [ 0.0, -4.2, 0.4 ], [ 0.0, 0.0, 0.5 ], [ 0.0, 0.0, 0.05 ] ],
[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] ],
[ [ 14.3, -5.9, -3.0 ], [ 5.2, -4.1, -0.3 ], [ 0.0, 0.0, 0.5 ], [ 0.0, 0.0, 0.05 ] ] ] )
} ),
'Test Line' : ScaffoldPackage(MeshType_1d_path1, {
'scaffoldSettings' : {
'Coordinate dimensions' : 3,
Expand All @@ -103,18 +156,23 @@ def getParameterSetNames():
'Default',
'Human 1',
'Human 2',
'Mouse 1']
'Mouse 1',
'Pig 1']

@classmethod
def getDefaultOptions(cls, parameterSetName='Default'):
if 'Human 2' in parameterSetName:
centralPathOption = cls.centralPathDefaultScaffoldPackages['Human 2']
elif 'Mouse' in parameterSetName:
centralPathOption = cls.centralPathDefaultScaffoldPackages['Mouse 1']
elif 'Pig' in parameterSetName:
centralPathOption = cls.centralPathDefaultScaffoldPackages['Pig 1']
else:
centralPathOption = cls.centralPathDefaultScaffoldPackages['Human 1']
if 'Mouse' in parameterSetName:
segmentProfileOption = ScaffoldPackage(MeshType_3d_colonsegmentsimplemesentery1, defaultParameterSetName = 'Mouse 1')
elif 'Pig' in parameterSetName:
segmentProfileOption = ScaffoldPackage(MeshType_3d_colonsegmentteniacoli1, defaultParameterSetName = 'Pig 1')
else:
segmentProfileOption = ScaffoldPackage(MeshType_3d_colonsegmentteniacoli1, defaultParameterSetName = 'Human 1')
options = {
Expand All @@ -126,6 +184,8 @@ def getDefaultOptions(cls, parameterSetName='Default'):
'Refine number of elements along' : 1,
'Refine number of elements through wall' : 1
}
if 'Pig' in parameterSetName:
options['Number of segments'] = 120
return options

@staticmethod
Expand Down Expand Up @@ -211,14 +271,14 @@ def generateBaseMesh(region, options):
else: # segmentScaffoldType == MeshType_3d_colonsegmentteniacoli1:
elementsCountAroundTC = segmentSettings['Number of elements around tenia coli']
elementsCountAroundHaustrum = segmentSettings['Number of elements around haustrum']
elementsCountAround = (elementsCountAroundTC + elementsCountAroundHaustrum)*3
cornerInnerRadiusFactor = segmentSettings['Corner inner radius factor']
haustrumInnerRadiusFactor = segmentSettings['Haustrum inner radius factor']
segmentLengthEndDerivativeFactor = segmentSettings['Segment length end derivative factor']
segmentLengthMidDerivativeFactor = segmentSettings['Segment length mid derivative factor']
tcCount = segmentSettings['Number of tenia coli']
tcWidth = segmentSettings['Tenia coli width']
tcThickness = segmentSettings['Tenia coli thickness']
elementsCountAround = (elementsCountAroundTC + elementsCountAroundHaustrum)*tcCount

elementsCountAlongSegment = segmentSettings['Number of elements along segment']
elementsCountThroughWall = segmentSettings['Number of elements through wall']
Expand Down Expand Up @@ -263,7 +323,7 @@ def generateBaseMesh(region, options):
annotationGroupsTC, nextNodeIdentifier, nextElementIdentifier = getTeniaColi(region, nextNodeIdentifier, nextElementIdentifier,
useCrossDerivatives, useCubicHermiteThroughWall, xList, d1List, d2List, d3List, elementsCountAroundTC, elementsCountAroundHaustrum,
elementsCountAlong, elementsCountThroughWall, wallThickness, tcWidth, tcThickness, sx, curvatureAlong, factorList, uList,
arcLengthOuterMidLength, length)
arcLengthOuterMidLength, length, tcCount)

annotationGroups += annotationGroupsTC

Expand Down
Loading

0 comments on commit 82d8e93

Please sign in to comment.