# print( pos_cen_matrix[ 0, : ] )

			length_HX = np.linalg.norm( HX )

			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_normal( 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 ) )
Exemplo n.º 2
0
            # print( pos_cen_matrix[ 0, : ] )

            length_HX = np.linalg.norm(HX)

            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_normal(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))
# Anatomy list
anatomy_list = [
    'left_caudate', 'left_putamen', 'right_caudate', 'right_putamen'
]

for a, anatomy in enumerate(anatomy_list):
    # base, tangent = rsm.LinearizedGeodesicRegression( ageList, CMRepDataList[ a ], max_iter, step_size, step_tol, False, False )

    # base.Write( "CMRep_Abstract_LinearizedGeodesicRegression_CTRL_" + anatomy + "_base.rpt" )
    # tangent.Write( "CMRep_Abstract_LinearizedGeodesicRegression_CTRL_" + anatomy + "_tangent.tVec" )

    print("===============================")
    print(" Reading.... ")
    print("===============================")

    base = manifolds.cmrep_abstract_normal(nManDim)
    base.Read("CMRep_Abstract_Normal_LinearizedGeodesicRegression_CTRL_" +
              anatomy + "_base.rpt")

    tangent = manifolds.cmrep_abstract_normal_tVec(nManDim)
    tangent.Read("CMRep_Abstract_Normal_LinearizedGeodesicRegression_CTRL_" +
                 anatomy + "_tangent.tVec")

    # Estimate CM-Rep Surface Trajectory to VTK
    # Reference VTK Poly data
    meanPolyData.GetPointData().RemoveArray("normals")
    meanPolyData.GetPointData().RemoveArray("Texture Coordinates")
    meanPolyData.GetPointData().RemoveArray("Covariant Tensor Determinant")
    meanPolyData.GetPointData().RemoveArray("Rho Function")
    meanPolyData.GetPointData().RemoveArray("Radius Function")
    meanPolyData.GetPointData().RemoveArray("Phi")