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/NikVard/memstim-hh
03 January 2024, 01:25:48 UTC
  • Code
  • Branches (12)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/NewOpt_6Hz
    • refs/heads/PRC_new_params
    • refs/heads/backup_working_june_2022
    • refs/heads/cuda
    • refs/heads/master
    • refs/heads/minimodel
    • refs/heads/revision
    • refs/heads/working_on_figures
    • refs/tags/v1.0
    • refs/tags/v1.0a
    • refs/tags/v1.0b
    • refs/tags/v1.0c
    No releases to show
  • b10764b
  • /
  • src
  • /
  • plot3d.py
Raw File Download Save again
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 ...

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
swh:1:cnt:22d6967b6297a4ca9bda5a720243c42b46fdb634
origin badgedirectory badge
swh:1:dir:8274ea81536d85d750c663677e5e06377757cee5
origin badgerevision badge
swh:1:rev:6f5b0c54a39579fc0fa992406d0d56cd383361cb
origin badgesnapshot badge
swh:1:snp:c2e27ce82d59e51c3aa0d7aaece24f9f6f9a2889

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
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 6f5b0c54a39579fc0fa992406d0d56cd383361cb authored by Nikolaos Vardalakis on 02 March 2023, 17:09:40 UTC
[DEL] Deleted old license
Tip revision: 6f5b0c5
plot3d.py
"""
--------------------------------------------------------------------------------
Date: 09/12/2021

@author: Nikolaos Vardalakis
--------------------------------------------------------------------------------

Implementation Notes
--------------------------------------------------------------------------------
    | 1: For plotting the hippocampal structure in 3D I will be using a library
    | developed by Nicolas P. Rougier and can be found here:
    |       https://github.com/rougier/matplotlib-3d/
    | The following functions are wrappers, taken from his example code.
"""

import numpy as np

from mpl3d import glm
from mpl3d.camera import Camera


class Scatter:

    def __init__(self, ax, transform,
                 vertices, sizes=50, facecolors="white", edgecolors="black"):

        self.vertices = vertices
        self.sizes = sizes
        self.facecolors = facecolors
        self.edgecolors = edgecolors
        self.scatter = ax.scatter([], [])
        self.outline = ax.scatter([], [], zorder=-20,
                     linewidth=2, edgecolor="black", facecolor="black")
        self.update(transform)

    def update(self, transform):
        vertices = glm.transform(self.vertices, transform)

        I = np.argsort(-vertices[:,2])
        vertices = vertices[I]
        facecolors = self.facecolors[I]
        edgecolors = self.edgecolors[I]
        sizes = self.sizes[I]
        self.outline.set_offsets(vertices[:,:2])
        self.outline.set_sizes(sizes)

        vertices = np.repeat(vertices,2,axis=0)
        facecolors = np.repeat(facecolors,2,axis=0)
        facecolors[::2] = 0,0,0,.1
        edgecolors = np.repeat(edgecolors,2,axis=0)
        edgecolors[::2] = 0,0,0,0
        sizes = np.repeat(sizes,2,axis=0)
        sizes[::2] *= 2

        Z = vertices[:,2]
        Z = (Z-Z.min())/(Z.max()-Z.min())
        Z = Z[::2].reshape(-1,1)
        facecolors[1::2,:3] = Z + (1-Z)*facecolors[1::2,:3]
        edgecolors[1::2,:3] = Z + (1-Z)*edgecolors[1::2,:3]
        self.scatter.set_offsets(vertices[:,:2])
        self.scatter.set_sizes(sizes)
        self.scatter.set_facecolors(facecolors)
        self.scatter.set_edgecolors(edgecolors)

back to top

Software Heritage — Copyright (C) 2015–2026, 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— Content policy— Contact— JavaScript license information— Web API