Show morphometry statistics results better

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
kaide jin
Posts: 5
Joined: Thu Jul 31, 2014 11:43 am

Show morphometry statistics results better

Post by kaide jin »

Hi

I can use morphometry statistics to measure the sulcal results. But the results are shown in seperate files. like "morpho_S.Rh._left-S.T.pol._left.dat", or "morpho_S.C._left-S.Pe.C.inter._left.dat", not one file inculding all sucli and all measurements (depth, width)

Thus I use two commands to put all results into one summary file including the all sucli.
1 "head -n 1 morpho_F.Cal.ant.-Sc.Cal._left.dat >> summary_stats.txt"
2 "for x in `ls *.dat` ; do tail -n 1 ${x} >> summary_stats.txt ; done"

Then I use WinSCP to put this summary file from Linux to Windows and use Excel to open it.

Would you please tell me a better way to make the summary file including all sucli ?

Thanks for your help
Kaide
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: Show morphometry statistics results better

Post by riviere »

Hi Kaide,
Yes the morphometry outputs are split by structure (by sulcus, here). This was designed like this originally to avoid mixing up inhomogen features for different structure types (sulci and relations between sucli for instance).
We have started reworking this part, but for the current time what you have done is OK.
If I understand your problem is that you are using a concatenation script which only works on linux, while exploiting the morphometry in Excel on Windows ? Then you could use a more portable concatenation script which would also work on Windows. Use python...
A python script for that could look like this:

Code: Select all

import glob, sys
out_filename = sys.argv[1] # '/tmp/summary_stats.txt'
in_filenames = sys.argv[2:] # or use glob.glob('*.dat')
out_file = open(out_filename, 'w')
out_file.write(open(in_filenames[0]).read())
for in_filename in in_filenames[1:]:
    out_file.write(''.join(open(in_filename).readlines()[1:]))
Denis
kaide jin
Posts: 5
Joined: Thu Jul 31, 2014 11:43 am

Re: Show morphometry statistics results better

Post by kaide jin »

Hi Denis

Thanks for your reply.

Kaide
riviere wrote:Hi Kaide,
Yes the morphometry outputs are split by structure (by sulcus, here). This was designed like this originally to avoid mixing up inhomogen features for different structure types (sulci and relations between sucli for instance).
We have started reworking this part, but for the current time what you have done is OK.
If I understand your problem is that you are using a concatenation script which only works on linux, while exploiting the morphometry in Excel on Windows ? Then you could use a more portable concatenation script which would also work on Windows. Use python...
A python script for that could look like this:

Code: Select all

import glob, sys
out_filename = sys.argv[1] # '/tmp/summary_stats.txt'
in_filenames = sys.argv[2:] # or use glob.glob('*.dat')
out_file = open(out_filename, 'w')
out_file.write(open(in_filenames[0]).read())
for in_filename in in_filenames[1:]:
    out_file.write(''.join(open(in_filename).readlines()[1:]))
Denis
Post Reply