This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xl = np.array([3,4,0]) | |
xi = xl/np.linalg.norm(xi) | |
yl = np.array([4,3,0]) | |
norm = np.cross(yl,xi) | |
zi = norm/np.linalg.norm(norm) | |
yi = np.cross(zi,xi) | |
yi = yi/np.linalg.norm(yi) | |
#Transormation Matrix TM | |
TM = np.vstack([xi,yi,zi]).T |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getPortData(self, index): | |
""" | |
Add your code here that will return the appropriate objects for this step. | |
The index is the index of the port in the port list. If there is only one | |
provides port for this step then the index can be ignored. | |
:param index: Index of the port to return. | |
""" | |
# Data can be pasted here to send to other steps for testing, or grabbed from a file if we have larger data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import jsonify | |
from flask import request | |
from blackfynn import Blackfynn | |
import urllib2 | |
from service.app import app | |
from service.config import Config | |
import json | |
import csv | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import numpy as np | |
count = 0 | |
indexlist = [] | |
above12 = [] | |
filename = "C:\\Users\jkho021\Projects\SPARC\mapclient\src\mapclient\ecgDataExtended2.json" | |
data = {} | |
with open(filename) as f: | |
data['cache'] = json.load(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv, json, sys | |
import numpy as np | |
#if we are using utf-8 files, uncomment the next line | |
# sys.setdefaultencoding("UTF-8") #set the encode to utf8 | |
def load_json(filename): | |
with open(filename) as f: | |
data = json.load(f) | |
return data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _calculatePointOnPlane(self, x, y): | |
from opencmiss.utils.maths.algorithms import calculateLinePlaneIntersection | |
far_plane_point = self.unproject(x, -y, -1.0) | |
near_plane_point = self.unproject(x, -y, 1.0) | |
plane_point, plane_offset, plane_normal = self._model.getPlaneDescription() | |
point_on_plane = calculateLinePlaneIntersection(near_plane_point, far_plane_point, plane_point, plane_normal) | |
if len(self.grid) < 4: | |
self.grid.append(point_on_plane) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Created on 30 MOct, 2018 from mapclientplugins.meshgeneratorstep. | |
@author: Jesse Khorasanee | |
""" | |
import numpy as np | |
from opencmiss.zinc.field import Field | |
from opencmiss.zinc.glyph import Glyph | |
from opencmiss.zinc.graphics import Graphics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def init(self) | |
self._ui.sceneviewer_widget.grid = [] | |
def keyReleaseEvent(self, event): | |
if self._marker_mode_active: | |
self._marker_mode_active = False | |
self._ui.sceneviewer_widget._model = self._plane_model | |
self._ui.sceneviewer_widget._calculatePointOnPlane = None | |
self._ui.sceneviewer_widget.mousePressEvent = self._original_mousePressEvent | |
if len(self._ui.sceneviewer_widget.grid) is 4: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generateGridPoints4(pointsList, number_on_side, plane_normal): | |
# We generate our grid points by having 4 points that we assign weightings to | |
# based on how far we are away from them. | |
# INPUTS: | |
# pointsList : a list of four points defined in any 3D space. | |
# number_on_side : the number of nodes we have on each side of our array (ie 8 nodes if we have a 64 point grid). | |
# plane_normal : the normal of the plane we are creating points in. EG [0,0,1] for the x,y plane. | |
# OUTPUTS: |