izaletel / NeuroMorpho-Access-Tool

NeuroMorpho Access Tool (NMAT) is a simple GUI that can be used to easily access and obtain information from the NeuroMorpho.Org database
MIT License
0 stars 0 forks source link

Code fixes - Column reordering #25

Open izaletel opened 2 years ago

izaletel commented 2 years ago

The columns should be reorder. Mainly, 'Length', should be bellow 'Depth' and 'Fractal dimension' at the end. This is the appropriate order:

df_dict = {}
df_dict['Neuron ID'] = []
df_dict['Surface'] = []
df_dict['Volume'] = []
df_dict['Soma surface'] = []
df_dict['Number of stems'] = []
df_dict['Number of bifurcations'] = []
df_dict['Number of branches'] = []
df_dict['Width'] = []
df_dict['Height'] = []
df_dict['Depth'] = []
df_dict['Length'] = []
df_dict['Diameter'] = []
df_dict['Euclidian distance'] = []
df_dict['Path distance'] = []
df_dict['Branching order'] = []
df_dict['Contraction'] = []
df_dict['Fragmentation'] = []
df_dict['Partition asymmetry'] = []
df_dict['Pk classic'] = []
df_dict['Bifurcation angle local'] = []
df_dict['Bifurcation angle remote'] = []
df_dict['Fractal dimension'] = []
for row in morphometry:
    df_dict['Neuron ID'].append(str(row['neuron_id']))
    df_dict['Surface'].append(str(row['surface']))
    df_dict['Volume'].append(str(row['volume']))
    df_dict['Soma surface'].append(str(row['soma_Surface']))
    df_dict['Number of stems'].append(str(row['n_stems']))
    df_dict['Number of bifurcations'].append(str(row['n_bifs']))
    df_dict['Number of branches'].append(str(row['n_branch']))
    df_dict['Width'].append(str(row['width']))
    df_dict['Height'].append(str(row['height']))
    df_dict['Depth'].append(str(row['depth']))
    df_dict['Length'].append(str(row['length']))
    df_dict['Diameter'].append(str(row['diameter']))
    df_dict['Euclidian distance'].append(str(row['eucDistance']))
    df_dict['Path distance'].append(str(row['pathDistance']))
    df_dict['Branching order'].append(str(row['branch_Order']))
    df_dict['Contraction'].append(str(row['contraction']))
    df_dict['Fragmentation'].append(str(row['fragmentation']))
    df_dict['Partition asymmetry'].append(str(row['partition_asymmetry']))
    df_dict['Pk classic'].append(str(row['pk_classic']))
    df_dict['Bifurcation angle local'].append(str(row['bif_ampl_local']))
    df_dict['Bifurcation angle remote'].append(str(row['bif_ampl_remote']))    
    df_dict['Fractal dimension'].append(str(row['fractal_Dim']))
    morphometry_df = pd.DataFrame(df_dict)
weeduck commented 2 years ago

Column order is not fixed in python, but I can change it. Is there a reason for the change?

izaletel commented 2 years ago

It's just more logical as those are similar parameters and should be next to each other. Also, the NM website shows them in this order i wrote.