[Homer-users] PMI Matlab not functioning properly

thuppert thuppert at nmr.mgh.harvard.edu
Thu Feb 16 09:08:07 EST 2006
Search archives:

This question concerns the PMI lab's program tMCimg (not Homer).  tMCimg is
code for running the Monte Carlo simulations of light propagation.  (Homer
is a signal-processing tool for functional analysis)... with that said, I'll
still answer the question as best I can (although I've never used this exact
program before).

Let's try to debug this...

On the Matlab command prompt type:

>> dbstop if error all

Now, run the  readMCHis program.  It should encounter an error in the
while-loop at the lines you indicated.

Look at the variables. They should be:

tmidx --> should be an interger  (the time gate index)
detidx --> should be an interger (indexing the detector)

size(phi)  --> should be #time pts x #detectors x #abs coef
size(data) --> should be (2 + #tissues) x 1.
size(dphi) --> should be #abs coef x 1.

size(muas) --> should be #abs coef  x  #tissue types   (i.e. 1x2)

 the command size(reshape(dphi', 1, 1, length(dphi)))  should be 1x1x#abs
coef    (or just #abs coef  depending on the version of Matlab).


If this is all right, try the command:
>>phi(tmidx,detidx,:) = phi(tmidx,detidx,:) + reshape(dphi', 1, 1,
length(dphi));

(I believe this is the line causing the error).  If everything worked up to
this point, but this line errors, then its a Matlab version issue.  (not the
first time either).
In which case, I'll need to think about it more.


... if you want, send me (thuppert at nmr.mgh.harvard.edu) the *.inp and *.his
file that is causing the trouble and I'll debug it.  I can send you a link
to a filedrop if the files are too large.


Ted Huppert, M.Sc.

PhD student-Harvard Univ.
Dept of Biophysics
Photon Migration Imaging lab
Mass General Hospital/CNY

Tele: (617)726-9338

thuppert at nmr.mgh.harvard.edu














  -----Original Message-----
  From: homer-users-bounces at nmr.mgh.harvard.edu
[mailto:homer-users-bounces at nmr.mgh.harvard.edu]On Behalf Of Bryan
McLaughlin
  Sent: Thursday, February 16, 2006 6:38 AM
  To: homer-users at nmr.mgh.harvard.edu
  Subject: [Homer-users] PMI Matlab not functioning properly


  Dear All,



  Is anyone familiar with the PMI Matlab program "readMCHis.m" which is
supposed to import Homer generated data?  If so, please read further.



  Perhaps you have a sample Matlab script with 'muas' vector and the
accompanying .his and .inp file that I can run to see how this code works?



  I have set up a simple homer simulation with a source and detector side by
side.  After sending 5 million photons, I get back a few hundred so that
seems fine.  For simplicity, I only used 2 tissue types and I have set each
to have the same absorption and scattering coefficients.



  Now I am trying to import the homer data into Matlab using "readMCHis.m"



  However, when this file runs these lines are crashing

      phi(tmidx,detidx,:) = phi(tmidx,detidx,:) + reshape(dphi', 1, 1,
length(dphi));

      num(tmidx,detidx)   = num(tmidx,detidx) + 1;





  Matlab returns this error:  "??? Assignment has more non-singleton rhs
dimensions than non-singleton

  subscripts."



  I have spent a few days trying to debug and just cannot seem to figure out
the problem.



  Thanks so much for any help!

  Regards,
  Bryan









                          Bryan McLaughlin
                          PhD Candidate
                         Cambridge University
                          544 King's College
                          Cambridge CB2 1ST
                          United Kingdom

                          bryan.mclaughlin at marshallscholarship.org
                          bm304 at cam.ac.uk
                          IM: mclaugb_uk
                         mobile:
                               UK 0+44+(0)7976 000620










              Add me to your address book...
             Want a signature like this?





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/homer-users/attachments/20060216/f88af3b9/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 4474 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/homer-users/attachments/20060216/f88af3b9/attachment.gif 


More information about the Homer-users mailing list