[MINC-users] Running MINC tools from the www user

Andrew Janke a.janke at gmail.com
Mon Apr 21 21:55:22 EDT 2008


Hi Burt,

>  2) If I precede the previous command with sudo -u _www, I get an error:
>  sudo -u _www /usr/local/minc2/bin/nu_correct -clobber -mapping_dir
>  /Library/MEDICS/tmp -tmpdir /Library/MEDICS/tmp/ -iterations 100 -shrink 3
>  -fwhm 0.1 -distance 100 -verbose /Library/MEDICS/tmp/abc1.mnc
>  /Library/MEDICS/tmp/abc.mnc
>
> ...
>
>  [_www at pita.crulrg.local:/usr/local/minc2/lib/perl5/site_perl]
>  [2008-04-21 14:44:23] /usr/local/minc2/bin/volume_stats -quiet -biModalT
>  /Library/MEDICS/tmp/abc1___.mnc
>
> Assertion failed at line 742 in file templates/CachedArray.cc
>
> nu_estimate_np_and_em: crashed while running volume_stats (termination
>  status=256)

I feel like I have just stepped into the middle of something here but
I would take a punt that this is OSX specific as I cannot seem to
replicate this under Ubuntu or Debian.   In my case I made a test user
and sudo'ed to there from root.  All seems to work fine but then
perhaps I have enough RAM that EBTKS behaves itself.

My first suggestion would be to dumb down your command to something like this:

   sudo -u _www /usr/local/minc2/bin/nu_correct -iterations 1 -verbose \
   /tmp/abc1.mnc /tmp/abc-out.mnc

To be sure that there are not permission errors.

>  5) I don't quite understand the MINC source code just yet (hey, that's a lot
>  of code), where would I find CachedArray.cc?

As per Alex said (given that he is the author of EBTKS!) however I
would be loathe to dig in the innards of that particular library as
other strange effects may surface elsewhere.

>  Is there a way I could just bypass the call to CachedArray and not bother
>  with trying to save memory (after all, GBytes are cheaper than the time
>  we're spending to try to make this work... ;)

My first suggestion would be to add the -nocache options to all the
volume_stats calls, I would also do this on a system level ie:

   cd /usr/local/minc2/bin
   mv volume_stats volume_stats.orig

   echo "#! /bin/sh" > volume_stats
   echo "volume_stats.orig -nocache $*" >> volume_stats
   chmod +x volume_stats

If this is still failing there is another option,....  but I will
likely be castigated for it.  I have long suggested that volume_stats
should be replaced with mincstats in nu_correct but there are
differences between the two in how they interpret histogram bins and
this results in a differing bimodalT for some histograms.  The results
from using mincstats are comparable to volume_stats but are not the
same.  It would be a difficult argument to prove which is better given
the simulations I have done on this so far.

In any case I have attached a patch for this (For
nu_estimate_np_and_em) but note that sharpen_volume still uses
volume_hist (something that mincstats can also do) so the differences
between the outputs of N3 are still very similar.

Good luck!


a


More information about the MINC-users mailing list