Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/jennyhelyanwe/post_MI_postprocessing
06 December 2024, 10:21:48 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    • 48c36cc0c5a8e853a4d97b18309493957e608091
    No releases to show
  • f27d72d
  • /
  • postprocessing_scripts
  • /
  • ep_pvpython_anterior_view_chronic.py
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:c3eabe4e4773fe079da717b864d15707cdf75c9f
origin badgedirectory badge Iframe embedding
swh:1:dir:a8a7d5884d0a84fa38356ad37ebde46e91c9e6ee
origin badgerevision badge
swh:1:rev:48c36cc0c5a8e853a4d97b18309493957e608091
origin badgesnapshot badge
swh:1:snp:186a3806b6eb2061558f5264a47b071c2be0e794
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 48c36cc0c5a8e853a4d97b18309493957e608091 authored by Jenny on 03 December 2024, 11:43:08 UTC
Cell model copyright and clean version
Tip revision: 48c36cc
ep_pvpython_anterior_view_chronic.py
# trace generated using paraview version 5.5.1

#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# create a new 'EnSight Reader'
heart_remeshed_3D_MAPSensicase = EnSightReader(CaseFileName='heart_remeshed_3D_MAPS.ensi.case')
heart_remeshed_3D_MAPSensicase.CellArrays = ['MIBDZ']
heart_remeshed_3D_MAPSensicase.PointArrays = ['ACTIV', 'RELAX']

# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView1.ViewSize = [1830, 910]

# show data in view
heart_remeshed_3D_MAPSensicaseDisplay = Show(heart_remeshed_3D_MAPSensicase, renderView1)

# get color transfer function/color map for 'ACTIV'
aCTIVLUT = GetColorTransferFunction('ACTIV')

# get opacity transfer function/opacity map for 'ACTIV'
aCTIVPWF = GetOpacityTransferFunction('ACTIV')

# create a new 'Calculator'
calculator1 = Calculator(Input=heart_remeshed_3D_MAPSensicase)

# Properties modified on calculator1
calculator1.ResultArrayName = 'ACTIV'
calculator1.Function = 'ACTIV - 0.1'

# create a new 'Calculator'
calculator2 = Calculator(Input=heart_remeshed_3D_MAPSensicase)

# Properties modified on calculator1
calculator2.ResultArrayName = 'RELAX'
calculator2.Function = 'RELAX - 0.1'

# show data in view
heart_remeshed_3D_MAPSensicaseDisplay = Show(calculator1, renderView1)


# trace defaults for the display properties.
heart_remeshed_3D_MAPSensicaseDisplay.Representation = 'Surface'
heart_remeshed_3D_MAPSensicaseDisplay.ColorArrayName = ['POINTS', 'ACTIV']
heart_remeshed_3D_MAPSensicaseDisplay.LookupTable = aCTIVLUT
heart_remeshed_3D_MAPSensicaseDisplay.OSPRayScaleArray = 'ACTIV'
heart_remeshed_3D_MAPSensicaseDisplay.OSPRayScaleFunction = 'PiecewiseFunction'
heart_remeshed_3D_MAPSensicaseDisplay.SelectOrientationVectors = 'ACTIV'
heart_remeshed_3D_MAPSensicaseDisplay.ScaleFactor = 1.1134918212890625
heart_remeshed_3D_MAPSensicaseDisplay.SelectScaleArray = 'ACTIV'
heart_remeshed_3D_MAPSensicaseDisplay.GlyphType = 'Arrow'
heart_remeshed_3D_MAPSensicaseDisplay.GlyphTableIndexArray = 'ACTIV'
heart_remeshed_3D_MAPSensicaseDisplay.GaussianRadius = 0.055674591064453126
heart_remeshed_3D_MAPSensicaseDisplay.SetScaleArray = ['POINTS', 'ACTIV']
heart_remeshed_3D_MAPSensicaseDisplay.ScaleTransferFunction = 'PiecewiseFunction'
heart_remeshed_3D_MAPSensicaseDisplay.OpacityArray = ['POINTS', 'ACTIV']
heart_remeshed_3D_MAPSensicaseDisplay.OpacityTransferFunction = 'PiecewiseFunction'
heart_remeshed_3D_MAPSensicaseDisplay.DataAxesGrid = 'GridAxesRepresentation'
heart_remeshed_3D_MAPSensicaseDisplay.SelectionCellLabelFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.SelectionPointLabelFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.PolarAxes = 'PolarAxesRepresentation'
heart_remeshed_3D_MAPSensicaseDisplay.ScalarOpacityFunction = aCTIVPWF
heart_remeshed_3D_MAPSensicaseDisplay.ScalarOpacityUnitDistance = 0.15441996066771663

# init the 'PiecewiseFunction' selected for 'ScaleTransferFunction'
heart_remeshed_3D_MAPSensicaseDisplay.ScaleTransferFunction.Points = [0.0941338837146759, 0.0, 0.5, 0.0, 0.17861036956310272, 1.0, 0.5, 0.0]

# init the 'PiecewiseFunction' selected for 'OpacityTransferFunction'
heart_remeshed_3D_MAPSensicaseDisplay.OpacityTransferFunction.Points = [0.0941338837146759, 0.0, 0.5, 0.0, 0.17861036956310272, 1.0, 0.5, 0.0]

# init the 'GridAxesRepresentation' selected for 'DataAxesGrid'
heart_remeshed_3D_MAPSensicaseDisplay.DataAxesGrid.XTitleFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.DataAxesGrid.YTitleFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.DataAxesGrid.ZTitleFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.DataAxesGrid.XLabelFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.DataAxesGrid.YLabelFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.DataAxesGrid.ZLabelFontFile = ''

# init the 'PolarAxesRepresentation' selected for 'PolarAxes'
heart_remeshed_3D_MAPSensicaseDisplay.PolarAxes.PolarAxisTitleFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.PolarAxes.PolarAxisLabelFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.PolarAxes.LastRadialAxisTextFontFile = ''
heart_remeshed_3D_MAPSensicaseDisplay.PolarAxes.SecondaryRadialAxesTextFontFile = ''

# reset view to fit data
renderView1.ResetCamera()

# show color bar/color legend
heart_remeshed_3D_MAPSensicaseDisplay.SetScalarBarVisibility(renderView1, True)

# update the view to ensure updated data information
renderView1.Update()

# Properties modified on renderView1
renderView1.Background = [1.0, 0.9999694819562066, 0.9999847409781033]

# get color legend/bar for aCTIVLUT in view renderView1
aCTIVLUTColorBar = GetScalarBar(aCTIVLUT, renderView1)

# Properties modified on aCTIVLUTColorBar
aCTIVLUTColorBar.TitleColor = [0.0, 0.0, 0.0]
aCTIVLUTColorBar.LabelColor = [0.0, 0.0, 0.0]

# Apply a preset using its name. Note this may not work as expected when presets have duplicate names.
aCTIVLUT.ApplyPreset('Viridis (matplotlib)', True)

# invert the transfer function
aCTIVLUT.InvertTransferFunction()

# Properties modified on aCTIVLUT
aCTIVLUT.UseAboveRangeColor = 1

# Rescale transfer function
aCTIVLUT.RescaleTransferFunction(0.0, 0.1)

# Rescale transfer function
aCTIVPWF.RescaleTransferFunction(0.0, 0.1)

# update the view to ensure updated data information
renderView1.Update()

# current camera placement for renderView1
renderView1.CameraPosition = [-0.6724053313482523, -22.935267852652938, -14.901676431710165]
renderView1.CameraFocalPoint = [-1.932643290497403, 3.7388620744344685, -1.1013163768208816]
renderView1.CameraViewUp = [0.10380819554912385, -0.45315626001400633, 0.8853661742730818]
renderView1.CameraParallelScale = 7.779858310767237

# save screenshot
SaveScreenshot('anterior_activation_map_chronic.png', renderView1, ImageResolution=[1830, 910],
    # PNG options
    CompressionLevel='0',TransparentBackground=1)

# show color bar/color legend
heart_remeshed_3D_MAPSensicaseDisplay.SetScalarBarVisibility(renderView1, False)

# show data in view
heart_remeshed_3D_MAPSensicaseDisplay = Show(calculator2, renderView1)

# set scalar coloring
ColorBy(heart_remeshed_3D_MAPSensicaseDisplay, ('POINTS', 'RELAX'))

# Hide the scalar bar for this color map if no visible data is colored by it.
HideScalarBarIfNotNeeded(aCTIVLUT, renderView1)

# rescale color and/or opacity maps used to include current data range
heart_remeshed_3D_MAPSensicaseDisplay.RescaleTransferFunctionToDataRange(True, False)

# show color bar/color legend
heart_remeshed_3D_MAPSensicaseDisplay.SetScalarBarVisibility(renderView1, True)

# get color transfer function/color map for 'RELAX'
rELAXLUT = GetColorTransferFunction('RELAX')

# Properties modified on aCTIVLUT
rELAXLUT.UseAboveRangeColor = 1

# Apply a preset using its name. Note this may not work as expected when presets have duplicate names.
rELAXLUT.ApplyPreset('Magma (matplotlib)', True)

# invert the transfer function
rELAXLUT.InvertTransferFunction()

# get color legend/bar for rELAXLUT in view renderView1
rELAXLUTColorBar = GetScalarBar(rELAXLUT, renderView1)

# Properties modified on rELAXLUTColorBar
rELAXLUTColorBar.TitleColor = [0.0, 0.0, 0.0]
rELAXLUTColorBar.LabelColor = [0.0, 0.0, 0.0]

# Rescale transfer function
rELAXLUT.RescaleTransferFunction(0.15, 0.6)

# get opacity transfer function/opacity map for 'RELAX'
rELAXPWF = GetOpacityTransferFunction('RELAX')

# Rescale transfer function
rELAXPWF.RescaleTransferFunction(0.15, 0.6)

# current camera placement for renderView1
renderView1.CameraPosition = [-0.6724053313482523, -22.935267852652938, -14.901676431710165]
renderView1.CameraFocalPoint = [-1.932643290497403, 3.7388620744344685, -1.1013163768208816]
renderView1.CameraViewUp = [0.10380819554912385, -0.45315626001400633, 0.8853661742730818]
renderView1.CameraParallelScale = 7.779858310767237

# save screenshot
SaveScreenshot('anterior_repolarisation_map_chronic.png', renderView1, ImageResolution=[1830, 910],
    # PNG options
    CompressionLevel='0',TransparentBackground=1)

#### saving camera placements for all active views

# current camera placement for renderView1
renderView1.CameraPosition = [-0.6724053313482523, -22.935267852652938, -14.901676431710165]
renderView1.CameraFocalPoint = [-1.932643290497403, 3.7388620744344685, -1.1013163768208816]
renderView1.CameraViewUp = [0.10380819554912385, -0.45315626001400633, 0.8853661742730818]
renderView1.CameraParallelScale = 7.779858310767237

#### uncomment the following to render all views
# RenderAllViews()
# alternatively, if you want to write images, you can use SaveScreenshot(...).

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top