Q: Hi all, I’d like to use Emma for Matlab-based visualization, but my Matlab license here does not include Mex (at least for the time being). I don’t have much expectations, but I was wondering: is there any way around this in order to use Emma?
http://www.bic.mni.mcgill.ca/pipermail/minc-users/2008-April/001961.html

A: I once wrote a program called mincsample for doing this sort of thing. The only spanner in the works is that I primarily wrote it for doing random samples from files based upon a mask. It allows you to do things like this:

gordon:~$ mincsample -random_samples 10 -coords ~/data/me/a.mnc
−97.553589999999999804 −10.734777364705921698 −108.63487000000000648
1.9928282597085527073
−97.553589999999999804 107.16522058039204524 −88.947370000000006485
1.0070954451819638109
−81.616089999999999804 117.06522040784302874 −75.822370000000006485
7.0038910505836575737
−1.9285899999999998045 62.165221364705800511 −66.447370000000006485
46.982528419928279106
−23.491089999999999804 131.46522015686261398 −66.447370000000006485
2.0080872816052490748
−31.928589999999999804 67.565221270588153857 −9.2598700000000064847
38.989852750438693363
97.446410000000000196 90.965220862744999408 4.8026299999999935153

11.996643015182726799
−111.6160899999999998 84.665220972548922873 74.177629999999993515 1.9958800640878919808
−115.3660899999999998 58.565221427450900649 106.99012999999999352 1.0070954451819638109
36.508910000000000196 −28.734777050980419233 122.92762999999999352 0

Where here the output is the coordinate followed by the value.

gordon:~$ mincsample -help
Command-specific options:
General options:
-version: print version info and exit.
-verbose: print out extra information.
-quiet: be very quiet.
-clobber: clobber existing files.
-max_buffer: maximum size of buffers (in kbytes)
Default value: 4096
-mask: select voxels within the specified mask
-mask_val: mask value to use
Default value: 1
Sampling Types:
-all: sample all the data (Default)
-random_seed: Random seed to use (use to get reproducible runs)
Default: use tv_usec
Default value: −1
-random_samples: take # random samples from the input data
Default value: 0
Output Options:
-sample: Output a <mask.mnc> file of chosen points
-outfile: <file> for output data (Default: stdout)
-append: append output data to existing file
-ascii: Write out data as ascii strings (default)
-double: Write out data as double precision floating-point values
-coords: Write out world co-ordinates as well as values
Generic options for all commands:
-help: Print summary of command-line options and abort
-version: Print version number of program and exit
Usage: mincsample [options] <in1.mnc> <in2.mnc> …

      mincsample -help

The help output is above, so in essence if you can convert your tag points to a mask then all you would need to do is this:

  mincsample -coords -ascii -mask tag_mask.mnc infile.mnc

if you wanted output like the above example. If you wanted to save a bit of space and output in double then just swap the -ascii flag with a -double. You can find mincsample (in deb and source form) on packages.bic.mni.mcgill.ca.

Let me know if you need any more help with it, the simple answer here is that I should add tag support to mincsample (Anders Rodell is already requesting this!) but just haven’t got to it yet… :)