diff --git a/mevislab.github.io/content/examples/summary/TutorialSummary_UI.zip b/mevislab.github.io/content/examples/summary/TutorialSummary_UI.zip index adcd312c3..14edb7409 100644 Binary files a/mevislab.github.io/content/examples/summary/TutorialSummary_UI.zip and b/mevislab.github.io/content/examples/summary/TutorialSummary_UI.zip differ diff --git a/mevislab.github.io/content/examples/thirdparty/pytorch1/PyTorchSegmentationExample.zip b/mevislab.github.io/content/examples/thirdparty/pytorch1/PyTorchSegmentationExample.zip index 219f29c26..0b36a07b4 100644 Binary files a/mevislab.github.io/content/examples/thirdparty/pytorch1/PyTorchSegmentationExample.zip and b/mevislab.github.io/content/examples/thirdparty/pytorch1/PyTorchSegmentationExample.zip differ diff --git a/mevislab.github.io/content/examples/visualization/example8/VisualizationExample8.mlab b/mevislab.github.io/content/examples/visualization/example8/VisualizationExample8.mlab index fe0871483..cf20743b2 100644 --- a/mevislab.github.io/content/examples/visualization/example8/VisualizationExample8.mlab +++ b/mevislab.github.io/content/examples/visualization/example8/VisualizationExample8.mlab @@ -350,14 +350,14 @@ CTX = ctx # ctx is the network's context, not RunPythonScript's" graph = ctx.field("DtfSkeletonization.outBase1").object() if graph is not None: - label = "Label" - print('Num edges', len(graph.getEdges())) - for edge in graph.getEdges(): - end_node = edge.getEndNode() - for skeleton in edge.getSkeletons(): - if label not in skeleton.properties: - skeleton.createPropertyDouble(label, skeleton.getProperty("MinDistance")) - skeleton.setProperty(label, skeleton.getProperty("MinDistance")) + label = "Label" + print('Num edges', len(graph.getEdges())) + for edge in graph.getEdges(): + end_node = edge.getEndNode() + for skeleton in edge.getSkeletons(): + if label not in skeleton.properties: + skeleton.createPropertyDouble(label, skeleton.getProperty("MinDistance")) + skeleton.setProperty(label, skeleton.getProperty("MinDistance")) ctx.field("GraphToVolume.update").touch() ctx.field("SoVascularSystem.apply").touch()*" diff --git a/mevislab.github.io/content/tutorials/summary/summary3.md b/mevislab.github.io/content/tutorials/summary/summary3.md index b66dd215c..9a9c21fa0 100644 --- a/mevislab.github.io/content/tutorials/summary/summary3.md +++ b/mevislab.github.io/content/tutorials/summary/summary3.md @@ -590,7 +590,7 @@ Interface { max = 1000 } Field selected3DView { - type = Enum + type = Enum items { item Segmented {} item File {} @@ -606,7 +606,7 @@ Interface { title = Reset } Field markerPosition { - type = Vector3 + type = Vector3 } Field applyMarker { type = Trigger @@ -687,7 +687,7 @@ Window { } } Box Info { - layout = Horizontal + layout = Horizontal Field totalVolume {} } } diff --git a/mevislab.github.io/content/tutorials/testing/testingexample1.md b/mevislab.github.io/content/tutorials/testing/testingexample1.md index 5ec535c27..247ea765c 100644 --- a/mevislab.github.io/content/tutorials/testing/testingexample1.md +++ b/mevislab.github.io/content/tutorials/testing/testingexample1.md @@ -66,24 +66,24 @@ from mevis import * from TestSupport import Base, Fields, Logging from TestSupport.Macros import * -filePath="C:/Program Files//Packages/MeVisLab/Resources/DemoData/BrainT1Dicom" +filePath = "C:/Program Files//Packages/MeVisLab/Resources/DemoData/BrainT1Dicom" def OpenFiles(): - ctx.field("DicomImport.inputMode").value = "Directory" - ctx.field("DicomImport.source").value = filePath - ctx.field("DicomImport.triggerImport").touch() - MLAB.processEvents() - while not ctx.field("DicomImport.ready").value: - MLAB.sleep(1) - Base.ignoreWarningAndError(MLAB.processEvents) - ctx.field("DicomImport.selectNextItem").touch() - MLAB.log("Files imported from: " + ctx.field("DicomImport.source").value) + ctx.field("DicomImport.inputMode").value = "Directory" + ctx.field("DicomImport.source").value = filePath + ctx.field("DicomImport.triggerImport").touch() + MLAB.processEvents() + while not ctx.field("DicomImport.ready").value: + MLAB.sleep(1) + Base.ignoreWarningAndError(MLAB.processEvents) + ctx.field("DicomImport.selectNextItem").touch() + MLAB.log("Files imported from: " + ctx.field("DicomImport.source").value) def TEST_DicomImport(): - expectedValue = 1.0 - OpenFiles() - currentValue = ctx.field("DicomImport.progress").value - ASSERT_FLOAT_EQ(expectedValue, currentValue) + expectedValue = 1.0 + OpenFiles() + currentValue = ctx.field("DicomImport.progress").value + ASSERT_FLOAT_EQ(expectedValue, currentValue) ``` {{}} diff --git a/mevislab.github.io/content/tutorials/testing/testingexample3.md b/mevislab.github.io/content/tutorials/testing/testingexample3.md index f3b5aefed..aed5ee362 100644 --- a/mevislab.github.io/content/tutorials/testing/testingexample3.md +++ b/mevislab.github.io/content/tutorials/testing/testingexample3.md @@ -61,7 +61,7 @@ Add the Python function to your *.script* file: {{< highlight filename="IterativeTestCase.py" >}} ```Python def ITERATIVETEST_TestWindowCenter(): - return testData, testPatient + return testData, testPatient ``` {{}} @@ -69,12 +69,12 @@ This function defines that testPatient shall be called {{< highlight filename="IterativeTestCase.py" >}} ```Python def testPatient(path, windowCenter): - ctx.field("LocalImage.name").value = patientPathPrefix + path - tree = ctx.field("LocalImage.outImage").getDicomTree() - importValue = str(tree.getTag("WindowCenter").value()) - dicomValue = str(ctx.field("DicomTagViewer.tagValue0").value) - ASSERT_EQ(windowCenter, importValue, "Checking expected WindowCenter value against DICOM tree value.") - ASSERT_EQ(windowCenter, dicomValue, "Checking expected WindowCenter value against DicomTagViewer value.") + ctx.field("LocalImage.name").value = patientPathPrefix + path + tree = ctx.field("LocalImage.outImage").getDicomTree() + importValue = str(tree.getTag("WindowCenter").value()) + dicomValue = str(ctx.field("DicomTagViewer.tagValue0").value) + ASSERT_EQ(windowCenter, importValue, "Checking expected WindowCenter value against DICOM tree value.") + ASSERT_EQ(windowCenter, dicomValue, "Checking expected WindowCenter value against DicomTagViewer value.") ``` {{}} @@ -104,11 +104,11 @@ Now, extend your network by adding a `View2D` module and connect it with the `Lo {{< highlight filename="IterativeTestCase.py" >}} ```Python def testPatient(path, windowCenter): - ... - Fields.setValue("View2D.startSlice", 0) - result = ScreenShot.createOffscreenScreenShot("View2D.self", "screentest.png") - Logging.showImage("My screenshot", result) - Logging.showFile("Link to screenshot file", result) + ... + Fields.setValue("View2D.startSlice", 0) + result = ScreenShot.createOffscreenScreenShot("View2D.self", "screentest.png") + Logging.showImage("My screenshot", result) + Logging.showFile("Link to screenshot file", result) ``` {{}} diff --git a/mevislab.github.io/content/tutorials/thirdparty/MONAI/monaiexample2.md b/mevislab.github.io/content/tutorials/thirdparty/MONAI/monaiexample2.md index e3aeb6157..69183a1d4 100644 --- a/mevislab.github.io/content/tutorials/thirdparty/MONAI/monaiexample2.md +++ b/mevislab.github.io/content/tutorials/thirdparty/MONAI/monaiexample2.md @@ -341,13 +341,13 @@ Let's implement the _getImage function first: ```Python ... def _getImage(): - if ctx.field("SwapFlipDimensions.output0").isValid(): - # Get image after all modifications have been done - image = ctx.field("SwapFlipDimensions.output0").image() + if ctx.field("SwapFlipDimensions.output0").isValid(): + # Get image after all modifications have been done + image = ctx.field("SwapFlipDimensions.output0").image() - return image - else: - return None + return image + else: + return None ... ``` {{}} @@ -447,7 +447,7 @@ Open the *.script* file and add a *Window* section. In this window, we reuse the ... Window { height = 100 - width = 100 + width = 100 Category { Viewer ROISelect.scene.self { type = SoRenderArea diff --git a/mevislab.github.io/content/tutorials/thirdparty/opencv/thirdpartyexample2.md b/mevislab.github.io/content/tutorials/thirdparty/opencv/thirdpartyexample2.md index 1444494ac..11753f3cb 100644 --- a/mevislab.github.io/content/tutorials/thirdparty/opencv/thirdpartyexample2.md +++ b/mevislab.github.io/content/tutorials/thirdparty/opencv/thirdpartyexample2.md @@ -50,14 +50,14 @@ After loading the file, go to the previously implemented *grabImage* function an {{< highlight filename=".py" >}} ```Python def grabImage(): - _, img = camera.read() - updateImage(img) - gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) - faces = face_cascade.detectMultiScale(gray, 1.1, 4) - for (x, y, w, h) in faces: - cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2) - # Display the output - cv2.imshow('img', img) + _, img = camera.read() + updateImage(img) + gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) + faces = face_cascade.detectMultiScale(gray, 1.1, 4) + for (x, y, w, h) in faces: + cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2) + # Display the output + cv2.imshow('img', img) ``` {{}} @@ -65,13 +65,13 @@ In the end, destroy all OpenCV windows in *releaseCamera* function. {{< highlight filename=".py" >}} ```Python def releaseCamera(_): - global camera, _interfaces - ctx.removeTimers() - _interfaces = [] - if camera: - camera.release() - camera = None - cv2.destroyAllWindows() + global camera, _interfaces + ctx.removeTimers() + _interfaces = [] + if camera: + camera.release() + camera = None + cv2.destroyAllWindows() ``` {{}} diff --git a/mevislab.github.io/content/tutorials/visualization/visualizationexample8.md b/mevislab.github.io/content/tutorials/visualization/visualizationexample8.md index fb4508364..bd9f12403 100644 --- a/mevislab.github.io/content/tutorials/visualization/visualizationexample8.md +++ b/mevislab.github.io/content/tutorials/visualization/visualizationexample8.md @@ -76,8 +76,8 @@ ctx.field("DtfSkeletonization.update").touch() graph = ctx.field("DtfSkeletonization.outBase1").object() if graph is not None: - for edge in graph.getEdges(): - print(edge.getId()) + for edge in graph.getEdges(): + print(edge.getId()) ctx.field("GraphToVolume.update").touch() ``` @@ -108,12 +108,12 @@ ctx.field("DtfSkeletonization.update").touch() graph = ctx.field("DtfSkeletonization.outBase1").object() if graph is not None: - label = "Label" - for edge in graph.getEdges(): - for skeleton in edge.getSkeletons(): - if label not in skeleton.properties: - skeleton.createPropertyDouble(label, edge.getId()) - skeleton.setProperty(label, edge.getId()) + label = "Label" + for edge in graph.getEdges(): + for skeleton in edge.getSkeletons(): + if label not in skeleton.properties: + skeleton.createPropertyDouble(label, edge.getId()) + skeleton.setProperty(label, edge.getId()) ctx.field("GraphToVolume.update").touch() ``` @@ -182,14 +182,14 @@ ctx.field("DtfSkeletonization.update").touch() graph = ctx.field("DtfSkeletonization.outBase1").object() if graph is not None: - label = "Label" - print('Num edges', len(graph.getEdges())) - for edge in graph.getEdges(): - end_node = edge.getEndNode() - for skeleton in edge.getSkeletons(): - if label not in skeleton.properties: - skeleton.createPropertyDouble(label, skeleton.getProperty("MinDistance")) - skeleton.setProperty(label, skeleton.getProperty("MinDistance")) + label = "Label" + print('Num edges', len(graph.getEdges())) + for edge in graph.getEdges(): + end_node = edge.getEndNode() + for skeleton in edge.getSkeletons(): + if label not in skeleton.properties: + skeleton.createPropertyDouble(label, skeleton.getProperty("MinDistance")) + skeleton.setProperty(label, skeleton.getProperty("MinDistance")) ctx.field("GraphToVolume.update").touch() ctx.field("SoVascularSystem.apply").touch() diff --git a/mevislab.github.io/static/images/tutorials/basicmechanics/with.png b/mevislab.github.io/static/images/tutorials/basicmechanics/with.png index dcbf3c0fe..6233ca63c 100644 Binary files a/mevislab.github.io/static/images/tutorials/basicmechanics/with.png and b/mevislab.github.io/static/images/tutorials/basicmechanics/with.png differ