Just my 5 cent of comments: Is there any reason why you want to use
Java? As Juan states, Java is high level and is developped for cross
platform applications for Sun, PC, Mac, Palm, PDA, ...Timing accuracy
was not a key issue in the development of Java. On the other hand, I
oppose Garrett a little (sorry :-) ): a complete real time operating
system is not necessary for millisecond accuracy (which is default for
cognitive science) and C really is faster then Java on a normal PC. The
C compiler generates machine code directly, the Java compiler generates
bytecode, which has to be interpreted by the Java Virtual Machine, which
converts the bytecode to machinecode and slows down the application. If
you really want to go hard real-time, you should write your application
in eg ADA.
There are some tools like Presentation and E-Prime which emulate the
best of both worlds and which have very good timing characteristics.
However, this costs you a little money, but you can start your fMRI
experiments right away and adds faster to you CV then first writing you
own program.
A freeware alternative is Cogent
(http://www.vislab.ucl.ac.uk/Cogent/index.html) which is quit extensive
and which runs on Matlab (which you already have because you mail to the
SPM mailing list ;-) ). Try it and maybe you'll like it, it's a matter
of taste.
I hope this can help you a little, I am always available for discussion.
Pieter
Garrett McGrath schreef:
> While this is true, sadly C isn't going to give you any better time
> accuracy if it's running on a normal computer. The bigger killer that
> many people are going to run into isn't whether or not a given
> language has garbage collection hamming up their processing but the
> fact that stimulus presentation is being done from a desktop
> computer. The variety of background processes doing different things
> at different times, like looking for updates or checking the status of
> your IRQ's are all going to have to be factored into your timing. A
> real solution would be to use a real time hardware / OS solution
> (linux is not an real time OS, nor it windows or mac), however the
> costs related to doing this are usually prohibitively expensive and
> the constraints of real time environments make things like video based
> stimulus presentation difficult or impossible. Sadly this doesn't
> really answer your question but presents more of a rabbit hole filled
> with embedded computing hardware (thou.. some of that hardware is java
> based).
> -Garrrett
>
> Juanjo Lull (UPV) wrote:
>> Dear Mathieu,
>> Java is not a low-level language such as C. Thus, the time accuracy
>> is quite less stringent than the time accuracy present in other
>> programming languages. Furthermore, garbage collection (i.e.
>> destruction of variables because they are not being currently used)
>> can happen at any time by default.
>> So the short answer is that Java does not guarantee time accuracy. It
>> is an excellent programming language for object oriented programming,
>> but it is not the best option: Workarounds can be done, but it is
>> very difficult to work with Java when synchronization is of high
>> priority anyway.
>> I hope this helps.
>> Yours sincerely,
>> Juan J.
>>
>> Mathieu d'Acremont wrote:
>>> Dear All,
>>>
>>> I would like to use the Java Programming Language to display stimuli
>>> and record response in a fMRI study (and then of course use SPM to
>>> analyze the data). I wonder how synchronization with the scanner can
>>> be done with Java an if Java guarantee time accuracy. Does anybody
>>> have experience with Java in fMRI experiment?
>>>
>>> Best,
>>>
>>
|