| from paraview.simple import * |
|
|
| |
| renderView1 = CreateView('RenderView') |
| renderView1.ViewSize = [900, 1400] |
|
|
| |
| renderView2 = CreateView('RenderView') |
| renderView2.ViewSize = [900, 1400] |
|
|
| SetActiveView(None) |
|
|
| |
| |
| |
|
|
| |
| layout1 = CreateLayout(name='Layout #1') |
| layout1.SplitHorizontal(0, 0.500000) |
| layout1.AssignView(1, renderView1) |
| layout1.AssignView(2, renderView2) |
| layout1.SetSize(1800, 1400) |
|
|
| |
| |
| |
|
|
| |
| ground_truthvtr = XMLRectilinearGridReader(registrationName='materials_ground_truth.vtr', FileName=['materials/data/materials_ground_truth.vtr']) |
| |
| ground_truthvtr.CellArrayStatus = ['Intensity', 'Phase'] |
|
|
| |
| cellDatatoPointData2 = CellDatatoPointData(registrationName='CellDatatoPointData2', Input=ground_truthvtr) |
| cellDatatoPointData2.CellDataArraytoprocess = ['Intensity', 'Phase'] |
|
|
| |
| isoVolume2 = IsoVolume(registrationName='IsoVolume2', Input=cellDatatoPointData2) |
| isoVolume2.InputScalars = ['POINTS', 'Intensity'] |
| isoVolume2.ThresholdRange = [0.2, 1.0] |
|
|
| |
| predictionvtr = XMLRectilinearGridReader(registrationName='materials_prediction.vtr', FileName=['materials/data/materials_prediction.vtr']) |
| |
| predictionvtr.CellArrayStatus = ['Intensity', 'Phase'] |
|
|
| |
| cellDatatoPointData1 = CellDatatoPointData(registrationName='CellDatatoPointData1', Input=predictionvtr) |
| cellDatatoPointData1.CellDataArraytoprocess = ['Intensity', 'Phase'] |
|
|
| |
| isoVolume1 = IsoVolume(registrationName='IsoVolume1', Input=cellDatatoPointData1) |
| isoVolume1.InputScalars = ['POINTS', 'Intensity'] |
| isoVolume1.ThresholdRange = [0.2, 1.0] |
|
|
| |
| clip1 = Clip(registrationName='Clip1', Input=isoVolume1) |
| clip1.ClipType = 'Plane' |
|
|
| |
| clip1.ClipType.Origin = [32.0, 32.0, 32.0] |
|
|
| |
| text1 = Text(registrationName='Text1') |
| text1.Text = 'NN Prediction' |
|
|
| |
| text2 = Text(registrationName='Text2') |
| text2.Text = 'Ground Truth' |
|
|
| |
| clip2 = Clip(registrationName='Clip2', Input=isoVolume2) |
| clip2.ClipType = 'Plane' |
|
|
| |
| clip2.ClipType.Origin = [32.0, 32.0, 32.0] |
|
|
| |
| |
| |
|
|
| |
| phaseLUT = GetColorTransferFunction('Phase') |
| phaseLUT.ApplyPreset("Viridis (matplotlib)") |
|
|
| |
| clip1Display = Show(clip1, renderView1, 'UnstructuredGridRepresentation') |
| clip1Display.ColorArrayName = ['POINTS', 'Phase'] |
| clip1Display.LookupTable = phaseLUT |
| clip1Display.RescaleTransferFunctionToDataRange(True) |
| clip1Display.SetScalarBarVisibility(renderView1, True) |
|
|
| |
| text1Display = Show(text1, renderView1, 'TextSourceRepresentation') |
| text1Display.Color = [0.0, 0.0, 0.0] |
| text1Display.FontFamily = 'Times' |
| text1Display.FontSize = 60 |
|
|
| |
| phaseLUTColorBar = GetScalarBar(phaseLUT, renderView1) |
| phaseLUTColorBar.WindowLocation = 'Any Location' |
| phaseLUTColorBar.Position = [0.8175077041602465, 0.01181592039800995] |
| phaseLUTColorBar.Title = 'Phase' |
| phaseLUTColorBar.ComponentTitle = '' |
| phaseLUTColorBar.TitleColor = [0.0, 0.0, 0.0] |
| phaseLUTColorBar.TitleFontFamily = 'Times' |
| phaseLUTColorBar.LabelColor = [0.0, 0.0, 0.0] |
| phaseLUTColorBar.LabelFontFamily = 'Times' |
| phaseLUTColorBar.Visibility = 1 |
|
|
| |
| |
| |
|
|
| |
| clip2Display = Show(clip2, renderView2, 'UnstructuredGridRepresentation') |
| clip2Display.ColorArrayName = ['POINTS', 'Phase'] |
| clip2Display.LookupTable = phaseLUT |
| clip2Display.RescaleTransferFunctionToDataRange(True) |
| clip2Display.SetScalarBarVisibility(renderView2, True) |
|
|
| |
| text2Display = Show(text2, renderView2, 'TextSourceRepresentation') |
| text2Display.Color = [0.0, 0.0, 0.0] |
| text2Display.FontFamily = 'Times' |
| text2Display.FontSize = 60 |
|
|
| |
| phaseLUTColorBar_1 = GetScalarBar(phaseLUT, renderView2) |
| phaseLUTColorBar_1.Title = 'Phase' |
| phaseLUTColorBar_1.ComponentTitle = '' |
| phaseLUTColorBar_1.TitleColor = [0.0, 0.0, 0.0] |
| phaseLUTColorBar_1.TitleFontFamily = 'Times' |
| phaseLUTColorBar_1.LabelColor = [0.0, 0.0, 0.0] |
| phaseLUTColorBar_1.LabelFontFamily = 'Times' |
| phaseLUTColorBar_1.Visibility = 1 |
|
|
| |
| SetActiveView(renderView1) |
| renderView1.ResetActiveCameraToNegativeZ() |
| camera = GetActiveCamera() |
| camera.Yaw(45) |
| renderView1.ResetCamera(True, 0.9) |
|
|
| SetActiveView(renderView2) |
| renderView2.ResetActiveCameraToNegativeZ() |
| camera = GetActiveCamera() |
| camera.Yaw(45) |
| renderView2.ResetCamera(True, 0.9) |
|
|
| |
| |
| |
|
|
| SaveScreenshot("materials/results/{agent_mode}/materials.png", layout1) |
|
|