Dear Deryk,
In addition to what Robert wrote you about I fixed several minor
problems that prevented the ctf_old option from working correctly.
This should be in the next public SPM8b update (with number above
2920). I don't know when Robert's fix will be available. I haven't
seen it yet but the bottom line of both options should be the same. In
the old reader there is also a workaround for .hc file problem so
using ctf_old option you can read your datasets without fixing that.
With my fixes I was able to convert your data using ctf_old option and
batch conversion, preprocess it and do imaging source reconstruction.
One thing that you should take care of if you want your source
reconstructions to be correct is that your data does not use synthetic
gradients for denoising. It was not even possible for us to determine
whether this is the case because that's exactly the part that was not
read correctly. You should check what setting you used during the
recording. If you used 3rd gradient or some other setting other than
'raw' you can convert your data back to 'raw' using CTF software.
Perhaps your CTF system can be upgraded to a more recent version of
CTF software and then some of these problems should go away.
Best,
Vladimir
On Mon, Mar 23, 2009 at 11:38 AM, Robert Oostenveld
<[log in to unmask]> wrote:
> Hi Deryk & Vladimir,
>
> I looked at the file and at the source code of the CTF reading functions for
> which you only have the *.p files. I cannot release the CTF source code to
> you (because CTF did not give permission for that), but it can give you some
> information:
>
> The problem is
>
> readCPersist: Stop strings (EndOfParameters) do not balance start strings
> (WS1_).
> (No. of start strings)-(No. of stop strings)=1.
>
> which traces back to
>
> K>> dbstack
>> In readCPersist at 257
> In readCTFds at 191
> In read_header at 673
>
> In readCTFds the code tries to read the *.acq file. In the old ctf readers
> that file was never used and it is not clear to me what it precisely
> contains. It is in the CPersist format, but seems to stop abrubtly. The
> CPersist file format is something like
> starttag, details, stoptag, starttag, details, stoptag, starttag, details,
> stoptag, starttag, details, stoptag, ...
> and this file seems to be short of a stoptag. Perhaps because it was
> unexpectedly trunctuated somehow (disk full, recording aborted)?
>
> But one level up in readCTFds it does the following
>
> % .acq file
> if exist([datasetname,delim,baseName,'.acq'])==2
> ds.acq=readCPersist([datasetname,delim,baseName,'.acq']);
> end
>
> which means that the corrupt data only affects the ds.acq field. The
> fieldtrip wrapper around the CTF reading function does not use that, so that
> means that the corrupt acq file should not affect fieldtrip... that means
> that there is yet another problem with this dataset.
>
> As a quick workaround in ctf2grad I have changed the lines of code around
> 190 into
>
> if all([hdr.res4.senres(selMEG).grad_order_no]==0)
> grad.balance.current = 'none';
> elseif all([hdr.res4.senres(selMEG).grad_order_no]==1)
> grad.balance.current = 'G1BR';
> elseif all([hdr.res4.senres(selMEG).grad_order_no]==2)
> grad.balance.current = 'G2BR';
> elseif all([hdr.res4.senres(selMEG).grad_order_no]==3)
> grad.balance.current = 'G3BR';
> else
> warning('cannot determine balancing of CTF gradiometers');
> grad = rmfield(grad, 'balance');
> end
>
> % sofar the gradiometer definition was the ideal, non-balenced one
> if isfield(grad, 'balance') && ~strcmp(grad.balance.current, 'none')
> % apply the current balancing parameters to the gradiometer definition
> grad = apply_montage(grad, getfield(grad.balance, grad.balance.current));
> end
>
> Instead of an error it now gives a warning and deletes the (somehow
> incomplete) balancing info.
>
> That basically gives you the same functionality as the ctf_old reader, but
> with the new reading functions.
>
> For now as solution that seems enough to me, as the problem seems to ly in
> the particular dataset and not in the general handling. Agreed?
>
> best regards,
> Robert
>
>
>
>
>
|