|
My Project
|
Functions | |
| def | Hierarchical (raw_tractography, MatrixDist_output, affinities_graph_output, MaxDistance_Threshold, dendogram_output) |
| def | Particional_Hierarchical (maxdist, var, arbfile, afffile, partfile) |
| def | Write_Retrieve_clusters (d_result, wfv) |
Variables | |
| pathname = os.path.dirname(__file__) | |
| exepath = os.path.join(pathname, "hierarchical") | |
| dir_raw_tractography = sys.argv[1] | |
| Path to the .bundles file that corresponds to the raw tractography. More... | |
| MatrixDist_output = os.path.join(pathname, "data","hierarch","matrixd.bin") | |
| affinities_graph_output = os.path.join(pathname, "data","hierarch","affin.txt") | |
| MaxDistance_Threshold = sys.argv[2] | |
| Maximum threshold of euclidian distance between pairs of fibers, 40 is recommended. More... | |
| dendogram_output = os.path.join(pathname, "data","hierarch","dendogram.txt") | |
| t0 = time.time() | |
| maxdist = float(sys.argv[3]) | |
| Maximum threshold of affinity, 30 is recommended. More... | |
| var = float(sys.argv[4]) | |
| Value related with the scale of similarity used, 3600 is recommended. More... | |
| result_path = sys.argv[5] | |
| Output directory path. More... | |
| arbfile = dendogram_output | |
| afffile = affinities_graph_output | |
| string | partfile = os.path.join(pathname, "data","hierarch","particion_")+str(maxdist)+".txt" |
| d_result = result_path | |
| wfv = CT.wforest_partition_maxdist_from_graph( arbfile,maxdist,True,afffile,var) | |
The segmentation code is ran like this:
python3 -m hclust <dir_raw_tractography> <MaxDistance_Threshold> <maxdist> <result_path>
| def hclust.main.Hierarchical | ( | raw_tractography, | |
| MatrixDist_output, | |||
| affinities_graph_output, | |||
| MaxDistance_Threshold, | |||
| dendogram_output | |||
| ) |
Run to Hierarchical clustering.
| def hclust.main.Particional_Hierarchical | ( | maxdist, | |
| var, | |||
| arbfile, | |||
| afffile, | |||
| partfile | |||
| ) |
Returns a ".txt" file with the detected clusters, where each list is a cluster. maxdist, 30 or 40mmm is recommended var = 3600 ##minimum affinity within a cluster => # N.exp( -max_cldist * max_cldist / var)
| def hclust.main.Write_Retrieve_clusters | ( | d_result, | |
| wfv | |||
| ) |
Return the clusters in the directory, d_result
| hclust.main.dir_raw_tractography = sys.argv[1] |
Path to the .bundles file that corresponds to the raw tractography.
Ruta al archivo .bundles que corresponde a la tractografía.
| hclust.main.maxdist = float(sys.argv[3]) |
Maximum threshold of affinity, 30 is recommended.
Máximo umbral de afinidad, se recomienda 30.
| hclust.main.MaxDistance_Threshold = sys.argv[2] |
Maximum threshold of euclidian distance between pairs of fibers, 40 is recommended.
Máximo umbral de distancia euclidiana entre pares de fibras, se recomienda 40.
| hclust.main.result_path = sys.argv[5] |
Output directory path.
Ruta del directorio de salida.
| hclust.main.var = float(sys.argv[4]) |
Value related with the scale of similarity used, 3600 is recommended.
Valor relacionado con la escala de similitud utilizada, se recomienda 3600.