Exemplo n.º 1
0
    # ==== 3-points: Probe as pointer in static & dynamic acquisition

    # Load file containing roto-translation from US image to global
    matrix_pap = np.load('matrices_julie_PaP1.npz')

    # Load file containing roto-translation from US image to global    
    matrix_dynamic = np.load('matrices_julie_dyn3.npz')
    
    # Get roto-translation from US image to global reference frame
    T_pap = matrix_pap['gTim']

    # Get roto-translation from US image to global reference frame
    T_dyn = matrix_dynamic['gTim']
    
    # Get single points features from file
    fea_pap = readFeaturesFile('feature_julie_PaP1.fea')   # it must contain one point feature per US image

    # Get single points features from file     
    fea_dyn = readFeaturesFile('feature_julie_dyn3.fea')   # it must contain one point feature per US image

    # Get metadata from dynamic trial files
    timing_data = np.load('us_time_vector_julie_dyn3.npz')
    usTimeVector = timing_data['usTimeVector'][0]
    fcOpto = 120.    
    
    # Indicate u, v (50mm as depth)
    u = 30./278
    v = 50./463
    
    # Calculate GLOBAL coordinates of muscle insertion - fem - STATIC
    idxP1 = [135,145,155,165,175]
Exemplo n.º 2
0
    # ==== 3-points: Probe as pointer in static & dynamic acquisition

    # Load file containing roto-translation from US image to global
    matrix_pap = np.load('matrices_test4feb_PaP1.npz')

    # Load file containing roto-translation from US image to global    
    matrix_dynamic = np.load('matrices_test4feb_dyn1.npz')
    
    # Get roto-translation from US image to global reference frame
    T_pap = matrix_pap['gTim']

    # Get roto-translation from US image to global reference frame
    T_dyn = matrix_dynamic['gTim']
    
    # Get single points features from file
    fea_pap = readFeaturesFile('PaP1.fea')   # it must contain one point feature per US image

    # Get single points features from file     
    fea_dyn = readFeaturesFile('dyn1.fea')   # it must contain one point feature per US image
    
    # Indicate u, v (50mm as depth)
    u = 30./278
    v = 50./463
    
    # Calculate GLOBAL coordinates of muscle insertion - fem - STATIC
    idxP1 = [214,216,218,220,222]
    P1 = singlePointFeaturesTo3DPointsMatrix(fea_pap, u, v, idx=idxP1)
    P1g = dot3(T_pap[idxP1,:,:], P1[...,None]).squeeze()  # Np x 4
    P1 = P1g.mean(axis=0)
    
    # Calculate GLOBAL coordinates of tendon insertion - calc - STATIC
Exemplo n.º 3
0
from Py3DFreeHandUS.segment import readFeaturesFile, singlePointFeaturesTo3DPointsMatrix
from Py3DFreeHandUS.kine import dot3
import numpy as np

if __name__ == "__main__":

    # ---- METHOD 1: 6-points probing
    
    # Load file containing roto-translation from US image to global
    matrix = np.load('matrices_testwire_3points_15.npz')
    
    # Get roto-translation from US image to global reference frame
    T = matrix['gTim']
    
    # Get single points features from file
    fea = readFeaturesFile('testwire15.fea')   # it must contain one point feature per US image
    
    # Indicate u, v
    u = 30./278
    v = 50./463
    
    # Calculate global coordinates of P1
    idxP1 = range(79,84)
    P1 = singlePointFeaturesTo3DPointsMatrix(fea, u, v, idx=idxP1)
    print P1
    P1g = dot3(T[idxP1,:,:], P1[...,None]).squeeze()[:,0:3]  # Np x 3
    P1 = P1g.mean(axis=0)
    print P1g.std(axis=0)
    
    # Calculate global coordinates of P2
    idxP2 = range(142,147)
Exemplo n.º 4
0
from Py3DFreeHandUS.kine import dot3
from Py3DFreeHandUS.muscles_analysis import MTJlengths
import numpy as np

if __name__ == "__main__":

    # ---- METHOD 1: 3-points probing

    # Load file containing roto-translation from US image to global
    matrix = np.load('matrices_plantar_3points.npz')
    
    # Get roto-translation from US image to global reference frame
    T = matrix['gTim']
    
    # Get single points features from file
    fea = readFeaturesFile('plantar_position1.fea')   # it must contain one point feature per US image
    
    # Indicate u, v
    u = 30./278
    v = 50./463
    
    # Calculate global coordinates of muscle insertion
    idxP1 = [3,5,8,12,16]
    P1 = singlePointFeaturesTo3DPointsMatrix(fea, u, v, idx=idxP1)
    P1g = dot3(T[idxP1,:,:], P1[...,None]).squeeze()[:,0:3]  # Np x 3
    P1 = P1g.mean(axis=0)
    
    # Calculate global coordinates of tendon insertion
    idxP2 = [510,512,515,518,521]
    P2 = singlePointFeaturesTo3DPointsMatrix(fea, u, v, idx=idxP2)
    P2g = dot3(T[idxP2,:,:], P2[...,None]).squeeze()[:,0:3]  # Np x 3