Z_H = np.divide(HX, length_HX) # Preshape Array Z_H_flatten = Z_H.flatten() print(np.linalg.norm(Z_H_flatten)) print(length) print(length_HX) # Set CM-Rep Abstract Point cmrep_ij = manifolds.cmrep_abstract(nAtoms) # Center center_ij = manifolds.euclidean(3) # print( "Center Of Mass " ) center_ij.SetPoint(cenOfMass) # Scale scale_ij = manifolds.pos_real(1) # print( "Scale" ) scale_ij.SetPoint(length_HX) # Abstract Position pos_ij = manifolds.sphere(3 * (nAtoms - 1)) # print( "Abstract Position" ) # print( np.array( Z_H_flatten ).flatten().shape ) # print( 3 * ( nAtoms - 1 ) )
reader.Update() polyData = reader.GetOutput() if cnt == 0: meanPolyDataList[a].DeepCopy(polyData) # print( polyData ) nAtoms_a = polyData.GetNumberOfPoints() nAtoms += nAtoms_a for k in range(nAtoms_a): pos = polyData.GetPoint(k) rad = polyData.GetPointData().GetArray( "Radius Function").GetValue(k) cmrep_ij_pos_a_k = manifolds.euclidean(3) cmrep_ij_rad_a_k = manifolds.pos_real(1) cmrep_ij_pos_a_k.SetPoint(pos) cmrep_ij_rad_a_k.SetPoint(rad) cmrep_ij.AppendAtom([cmrep_ij_pos_a_k, cmrep_ij_rad_a_k]) # cmrep_ij.UpdateMeanRadius() CMRepDataList.append(cmrep_ij) riskGroupList.append(dataInfoList[i].CAPGroupList[j]) ageList.append(dataInfoList[i].AgeList[j]) SubjectList.append(dataInfoList[i].ID) CAPList.append(dataInfoList[i].CAPList[j]) cnt += 1
import manifolds # Euclidean eucl_tVec = manifolds.euclidean_tVec( 3 ) eucl_tVec.SetTangentVector( [ 1, 3, 1 ] ) eucl_tVec.Write( "eucl_tVec.tvec" ) eucl_tVec_r = manifolds.euclidean_tVec( 3 ) eucl_tVec_r.Read( "eucl_tVec.tvec" ) print( eucl_tVec_r.tVector ) print( eucl_tVec_r.nDim ) print( eucl_tVec_r.Type ) eucl_pt = manifolds.euclidean( 3 ) eucl_pt.SetPoint( [ 3, 1, 5 ] ) eucl_pt.Write( "eucl.rpt" ) eucl_pt_r = manifolds.euclidean( 3 ) eucl_pt_r.Read( "eucl.rpt" ) print( eucl_pt_r.pt ) print( eucl_pt_r.nDim ) print( eucl_pt_r.Type ) # Sphere sphere_tVec = manifolds.sphere_tVec( 3 ) sphere_tVec.SetTangentVector( [ 0, 0.8192, 0 ] ) sphere_tVec.Write( "sphere_tVec.tvec" )