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

Burt Crépeault burt.crepeault at crulrg.ulaval.ca
Tue Apr 22 09:13:11 EDT 2008


Hi Alex and Andrew,

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.


Give it a try with sudo -u www-data on Ubuntu, the equivalent to _www under
OS X.

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.
>

Same as before.


> 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.
>

I must say I totally agree with you on this. I've a feeling I'd lose a
tremendous amount of time in there and end up doing more harm than good...


>  Alternatively, if you wanted to try to move on without identifying the
> source of this problem, you could add a '-nocache' flag to the call(s)
> to volume_stats in the nu_correct scripts (specifically in
> nu_estimate_np_and_em which throws this error). That should tell
> volume_stats to use the non-cached SimpleArray class instead of
> CachedArray as shown in the code snippet you listed.
>

[...]

 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
>

That's it!! It works! And the solution is delightfully simple too.


> 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.
>

I'm afraid that's something I'll have to let the scientists debate. For now,
I'll just use that marvelous workaround above.

Thank you so much,


-- 
Burt Crépeault
Research Assistant
Centre de Recherche de l'Université Laval - Robert-Giffard
+1-418-663-5741, ext 6844



-- 
Burt Crépeault
Research Assistant
Centre de Recherche de l'Université Laval - Robert-Giffard
418-663-5741, ext 6844


More information about the MINC-users mailing list