# MIS - Scripting Forum

**URL:** https://community.materialise.com/c/mis-scripting-forum/5.md?page=1

[Latest](https://community.materialise.com/latest.md) · [Categories](https://community.materialise.com/categories.md) · [Tags](https://community.materialise.com/tags.md)

**Page:** 2

---

## [Centerline Data and Measurements in Script](https://community.materialise.com/t/centerline-data-and-measurements-in-script/327)

<div class="topic-metadata">

**Author:** [@EntPyle](https://community.materialise.com/u/EntPyle)\
**Replies:** 2\
**Last updated:** [May 19, 2023, 8:46pm UTC](https://community.materialise.com/t/centerline-data-and-measurements-in-script/327 "2023-05-19T20:46:57Z")

</div>

I’m trying to use the centerline tool in a workflow, but there does not appear to be a way to programmatically create a centerline using the “Fit Centerline” tool in Mimics or the “Create Center Line” Tool in 3-matic. Am…

---

## [3 matic scripting to call out a sub\_tree under an object tree](https://community.materialise.com/t/3-matic-scripting-to-call-out-a-sub-tree-under-an-object-tree/726)

<div class="topic-metadata">

**Author:** [@Dennis07](https://community.materialise.com/u/Dennis07)\
**Replies:** 3\
**Last updated:** [February 24, 2023, 9:54am UTC](https://community.materialise.com/t/3-matic-scripting-to-call-out-a-sub-tree-under-an-object-tree/726 "2023-02-24T09:54:20Z")

</div>

i’m using 3 matic scripting to get contour from an imported STEP file. Is there a way to get a list of contours from the object tree?

---

## [3-matics create surface set](https://community.materialise.com/t/3-matics-create-surface-set/709)

<div class="topic-metadata">

**Author:** [@pmeth](https://community.materialise.com/u/pmeth)\
**Replies:** 3\
**Last updated:** [January 25, 2023, 11:26am UTC](https://community.materialise.com/t/3-matics-create-surface-set/709 "2023-01-25T11:26:27Z")

</div>

Hi, Is it possible to create a surface set in 3-matics? I can see various functions to work with SurfaceSets: trimatic.fix.surface\_sets\_to\_parts trimatic.types.Part.find\_surface\_set trimatic.types.Part.find\_surface\_s…

---

## [Default 3D views](https://community.materialise.com/t/default-3d-views/679)

<div class="topic-metadata">

**Author:** [@pmeth](https://community.materialise.com/u/pmeth)\
**Replies:** 1\
**Last updated:** [November 11, 2022, 1:00pm UTC](https://community.materialise.com/t/default-3d-views/679 "2022-11-11T13:00:01Z")

</div>

Is there an easy way to apply the default 3D views (Anterior, Left, Top, …) from a script? i.e. the same functionality provided by the “Select 3D View” in the GUI. Ideally I want this to apply a zoom and pan so that th…

---

## [Export fluoroscopy simulated image data](https://community.materialise.com/t/export-fluoroscopy-simulated-image-data/656)

<div class="topic-metadata">

**Author:** [@pmeth](https://community.materialise.com/u/pmeth)\
**Replies:** 1\
**Last updated:** [July 26, 2022, 9:47am UTC](https://community.materialise.com/t/export-fluoroscopy-simulated-image-data/656 "2022-07-26T09:47:30Z")

</div>

Using the command mimics.view.export\_simulated\_fluoroscopy() it is possible to export a simulated fluoroscopy image as a bmp,png,jpg,etc type image file. Is it possible to export the actual simulated fluoroscopy image d…

---

## [3-Matic-to-Mimics Script Connection Issue](https://community.materialise.com/t/3-matic-to-mimics-script-connection-issue/615)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 3\
**Last updated:** [April 27, 2022, 7:49am UTC](https://community.materialise.com/t/3-matic-to-mimics-script-connection-issue/615 "2022-04-27T07:49:12Z")

</div>

I’ve written a script that creates a spline in 3-Matic by creating the points in 3-Matic, then starting a new Mimics file, transferring the points to the Mimics file, creates a spline in the Mimics file, and transfers th…

---

## [Redirecting stderr](https://community.materialise.com/t/redirecting-stderr/622)

<div class="topic-metadata">

**Author:** [@Thijs](https://community.materialise.com/u/Thijs)\
**Replies:** 1\
**Last updated:** [March 25, 2022, 1:58pm UTC](https://community.materialise.com/t/redirecting-stderr/622 "2022-03-25T13:58:12Z")

</div>

Hi, I am trying to run a mimics script in the background and I want to redirect the standard output and the errors to a file. I am able to redirect stdout to a file, but I have no such luck with stderr: import sys sys.…

---

## [Using get\_triangles on Marked Triangles](https://community.materialise.com/t/using-get-triangles-on-marked-triangles/537)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 1\
**Last updated:** [December 29, 2021, 6:57pm UTC](https://community.materialise.com/t/using-get-triangles-on-marked-triangles/537 "2021-12-29T18:57:56Z")

</div>

I’ve been trying to pull the indices of the nodes marked by a mark triangles tool from a part. A bug I’ve been coming across is with the “marked\_triangles.get\_triangles()” command. According to the 3-Matic scripting guid…

---

## [Mimics.file Attribute Error](https://community.materialise.com/t/mimics-file-attribute-error/570)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 3\
**Last updated:** [December 17, 2021, 4:01pm UTC](https://community.materialise.com/t/mimics-file-attribute-error/570 "2021-12-17T16:01:07Z")

</div>

I’m attempting to import images to a new mimics file similar to the “Automatic import of DICOM images (Mimics 22.0)” post. Up until today, this script worked just fine. Now when I try to execute the script I get an error…

---

## [Custom Curve Point Distribution](https://community.materialise.com/t/custom-curve-point-distribution/564)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 1\
**Last updated:** [December 14, 2021, 5:23am UTC](https://community.materialise.com/t/custom-curve-point-distribution/564 "2021-12-14T05:23:05Z")

</div>

I’m attempting to distribute the points along curves that I generate in a script to my own custom segment distance. For example, the 140mm long curve that I have has around 1400 points. I’d like to be able to change the …

---

## [3-matic 16.0 "point-based pattern" issue](https://community.materialise.com/t/3-matic-16-0-point-based-pattern-issue/547)

<div class="topic-metadata">

**Author:** [@Teddy](https://community.materialise.com/u/Teddy)\
**Replies:** 2\
**Last updated:** [November 22, 2021, 7:37am UTC](https://community.materialise.com/t/3-matic-16-0-point-based-pattern-issue/547 "2021-11-22T07:37:25Z")

</div>

How could I find 3-matic technical support? We have been using 3-matic 13.0 (upper image) for several years and found it helpful. This year we bought a new version, 3-matic 16.0 (lower image). But all of our colleagues …

---

## [3-Matic Spline Scripting](https://community.materialise.com/t/3-matic-spline-scripting/542)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 2\
**Last updated:** [November 10, 2021, 12:10am UTC](https://community.materialise.com/t/3-matic-spline-scripting/542 "2021-11-10T00:10:57Z")

</div>

I’d like to be able to create a spline in 3-Matic using scripting, but I can’t seem to find anything on splines in the 3-Matic Scripting Guide. I know that spline functions are prevalent within Mimics, but I’d like to be…

---

## [Warping With Landmarks](https://community.materialise.com/t/warping-with-landmarks/528)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 4\
**Last updated:** [October 20, 2021, 10:10pm UTC](https://community.materialise.com/t/warping-with-landmarks/528 "2021-10-20T22:10:17Z")

</div>

I’m attempting to warp a template onto a patient using a landmark. From my understanding of the 3-Matic Scripting guide, the landmark input into the warping command should be a list of three floats. When I attempt to exe…

---

## [Distance Between Line and Point](https://community.materialise.com/t/distance-between-line-and-point/534)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 1\
**Last updated:** [October 1, 2021, 4:10pm UTC](https://community.materialise.com/t/distance-between-line-and-point/534 "2021-10-01T16:10:16Z")

</div>

I’m attempting to automate a certain measurement, but I can’t seem to find the right tools in 3-Matic. I have to find the shortest distance between a line a completely different point. I couldn’t find anything similar to…

---

## [Extracting Patient Coefficients From SSM Modes](https://community.materialise.com/t/extracting-patient-coefficients-from-ssm-modes/485)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 3\
**Last updated:** [September 1, 2021, 4:02pm UTC](https://community.materialise.com/t/extracting-patient-coefficients-from-ssm-modes/485 "2021-09-01T16:02:41Z")

</div>

Is it possible to extract the mode coefficients that correspond to the patients used to create the SSM? That is, what coefficient combination will yield an SSM instance equivalent to one of the patients used to create th…

---

## [Object Calling Error in 3-Matic](https://community.materialise.com/t/object-calling-error-in-3-matic/507)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 0\
**Last updated:** [August 19, 2021, 3:44pm UTC](https://community.materialise.com/t/object-calling-error-in-3-matic/507 "2021-08-19T15:44:16Z")

</div>

In the past I encountered an issue with 3-Matic not recognizing variables containing one object as that object and instead recognizing them as tuples, i.e. when ‘instance = trimatic.Part’ is called like this: ‘instance.v…

---

## [Create Part Comparison Analysis Error](https://community.materialise.com/t/create-part-comparison-analysis-error/505)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 0\
**Last updated:** [August 18, 2021, 5:13pm UTC](https://community.materialise.com/t/create-part-comparison-analysis-error/505 "2021-08-18T17:13:12Z")

</div>

I’m attempting to create a script that uses the ‘trimatic.create\_part\_comparison\_analysis’ command, but I’ve been running into a weird AttributeError. The code I’m using is the first picture below. The error is the secon…

---

## [Keyboard Listening in 3-Matic](https://community.materialise.com/t/keyboard-listening-in-3-matic/504)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 0\
**Last updated:** [August 17, 2021, 5:43pm UTC](https://community.materialise.com/t/keyboard-listening-in-3-matic/504 "2021-08-17T17:43:55Z")

</div>

I’m attempting to write a while loop that runs through a few lines of command over and over again until is pressed by the user. I’ve been trying to work with the keyboard module to do this. The functions I’ve tried so f…

---

## [Creating Plots in 3-Matic](https://community.materialise.com/t/creating-plots-in-3-matic/477)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 1\
**Last updated:** [August 5, 2021, 3:26pm UTC](https://community.materialise.com/t/creating-plots-in-3-matic/477 "2021-08-05T15:26:55Z")

</div>

I’m using an SSM to produce a large number of measurements and I’d like the script to output a chart of some kind to visually represent the measurement distribution. A histogram like the one in the 3-Matic SSM Properties…

---

## [RuntimeError While Using 'trimatic.convert\_ssm\_instance\_to\_part'](https://community.materialise.com/t/runtimeerror-while-using-trimatic-convert-ssm-instance-to-part/475)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 1\
**Last updated:** [July 26, 2021, 3:23pm UTC](https://community.materialise.com/t/runtimeerror-while-using-trimatic-convert-ssm-instance-to-part/475 "2021-07-26T15:23:49Z")

</div>

I’m attempting to create a new part from the average instance of an ssm and assign it to the variable “average\_part”, but I run into the RuntimeError in the bottom picture below. The code I used is in the top image below…

---

## [Affine Transformation](https://community.materialise.com/t/affine-transformation/422)

<div class="topic-metadata">

**Author:** [@ericabg](https://community.materialise.com/u/ericabg)\
**Replies:** 2\
**Last updated:** [July 21, 2021, 2:58pm UTC](https://community.materialise.com/t/affine-transformation/422 "2021-07-21T14:58:09Z")

</div>

Hello, I am trying to get the affine transformation to export masks into nifti format. I can get the data for the masks in an array format, and then I would also need the affine transformation. Therefore, I need the fol…

---

## [Iterative registration\_with\_scaling Error (3-Matic 16.0)](https://community.materialise.com/t/iterative-registration-with-scaling-error-3-matic-16-0/462)

<div class="topic-metadata">

**Author:** [@IAF2022](https://community.materialise.com/u/IAF2022)\
**Replies:** 4\
**Last updated:** [July 15, 2021, 3:34pm UTC](https://community.materialise.com/t/iterative-registration-with-scaling-error-3-matic-16-0/462 "2021-07-15T15:34:03Z")

</div>

I’m attempting to automate the registration/scaling process of multiple parts for the creation of SSM using a similar method as in the Statistical shape model creation DemoFiles script (see first photo), but when I run i…

---

## [Area measurement with spline connections](https://community.materialise.com/t/area-measurement-with-spline-connections/447)

<div class="topic-metadata">

**Author:** [@Thijs](https://community.materialise.com/u/Thijs)\
**Replies:** 2\
**Last updated:** [July 12, 2021, 5:10pm UTC](https://community.materialise.com/t/area-measurement-with-spline-connections/447 "2021-07-12T17:10:07Z")

</div>

Hi there, Does anyone know if it is possible to create an area measurement using Mimics scripting that has spline connections between the points? This is possible when defining an area measurement manually, but in the …

---

## [Dicom to Nifti format using mimics scripting. Problem with affine transformation matrix](https://community.materialise.com/t/dicom-to-nifti-format-using-mimics-scripting-problem-with-affine-transformation-matrix/438)

<div class="topic-metadata">

**Author:** [@ericabg](https://community.materialise.com/u/ericabg)\
**Replies:** 3\
**Last updated:** [July 8, 2021, 3:00pm UTC](https://community.materialise.com/t/dicom-to-nifti-format-using-mimics-scripting-problem-with-affine-transformation-matrix/438 "2021-07-08T15:00:12Z")

</div>

I am trying to export the masks in mimics to nifti format, via the scripting module. However, I have a question regarding affine transformations as I am getting something wrong in the process. I think it is a really sill…

---

## [Unable to close mimics through scripting](https://community.materialise.com/t/unable-to-close-mimics-through-scripting/448)

<div class="topic-metadata">

**Author:** [@Thijs](https://community.materialise.com/u/Thijs)\
**Replies:** 4\
**Last updated:** [July 7, 2021, 8:20am UTC](https://community.materialise.com/t/unable-to-close-mimics-through-scripting/448 "2021-07-07T08:20:55Z")

</div>

Hi! I am working on an automation script that should open a Mimics project, perform some changes and then close Mimics again. According to the documentation there should be the option to exit the application using: mi…

---

## [Possible to limit the cut tool within a plane?](https://community.materialise.com/t/possible-to-limit-the-cut-tool-within-a-plane/437)

<div class="topic-metadata">

**Author:** [@chast18](https://community.materialise.com/u/chast18)\
**Replies:** 2\
**Last updated:** [June 28, 2021, 1:52pm UTC](https://community.materialise.com/t/possible-to-limit-the-cut-tool-within-a-plane/437 "2021-06-28T13:52:28Z")

</div>

Maybe not a pure scripting topic, but giving it a try… When I use “Design-Cut” the cut plane will cut through all geometry crossing that plane. Even though it is outside of the cut planes limits. Is there a way to limit …

---

## [Dicom tags](https://community.materialise.com/t/dicom-tags/423)

<div class="topic-metadata">

**Author:** [@ericabg](https://community.materialise.com/u/ericabg)\
**Replies:** 1\
**Last updated:** [June 16, 2021, 2:38pm UTC](https://community.materialise.com/t/dicom-tags/423 "2021-06-16T14:38:53Z")

</div>

Hi, I am trying to get the dicom tags from the file that is currently open in Mimics. However, not all the tags seem to come up. For example, I use the following command: tags = mimics.get\_dicom\_tags() print(tags.key…

---

## [Embed custom add on to 3matic](https://community.materialise.com/t/embed-custom-add-on-to-3matic/372)

<div class="topic-metadata">

**Author:** [@EntPyle](https://community.materialise.com/u/EntPyle)\
**Replies:** 0\
**Last updated:** [January 20, 2021, 10:51pm UTC](https://community.materialise.com/t/embed-custom-add-on-to-3matic/372 "2021-01-20T22:51:08Z")

</div>

I have a few tools that I want to put in a toolkit inside 3matic. Id like to be able to embed my Gui inside 3matic. Other than using threaded\_trimatic, do yall have any recommendations for running a custom QT Gui in 3mat…

---

## [Disable GUI functions](https://community.materialise.com/t/disable-gui-functions/353)

<div class="topic-metadata">

**Author:** [@EntPyle](https://community.materialise.com/u/EntPyle)\
**Replies:** 2\
**Last updated:** [November 24, 2020, 7:30pm UTC](https://community.materialise.com/t/disable-gui-functions/353 "2020-11-24T19:30:56Z")

</div>

I attempted to speed up a loop over 200 files by using the mimics.disable\_update\_gui() method, but the gui definitely still updates. I’m using it just like it was used in the 4D hear cineloop demo script. I used this blo…

---

## [Transform Mesh using Transformation Matrix](https://community.materialise.com/t/transform-mesh-using-transformation-matrix/338)

<div class="topic-metadata">

**Author:** [@EntPyle](https://community.materialise.com/u/EntPyle)\
**Replies:** 4\
**Last updated:** [September 1, 2020, 2:23pm UTC](https://community.materialise.com/t/transform-mesh-using-transformation-matrix/338 "2020-09-01T14:23:07Z")

</div>

I’m trying to align meshes I have created in 3matic/mimics using a transformation matrix. Mimics does not allow me to apply a transformation to a mesh and 3matic does not allow me apply a transformation matrix at all (wh…

[Previous page](https://community.materialise.com/c/mis-scripting-forum/5.md)

[Next page](https://community.materialise.com/c/mis-scripting-forum/5.md?page=2)
