Bruker MPA OPUS spectra format Log Out | Topics | Search
Moderators | Register | Edit Profile

NIR Discussion Forum » Bruce Campbell's List » General, All others » Bruker MPA OPUS spectra format « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Geoff Downes (geoffd)
New member
Username: geoffd

Post Number: 2
Registered: 12-2011
Posted on Sunday, January 08, 2012 - 4:08 pm:   

Thanks to all for the ideas and macros to try. I do have a macro that converts OPUS to spc /dpt etc. But using OPUS 5.5 it's slow and tends to overload if I use too many files. I'll try some of the macros kindly offerred here. Thanks.

By way of background we are using a custom built fibre optic attachment to our Bruker MPA which collects spectra every 1 mm along a radial surface of wood. So if I have a project that involves 100 wood samples each 100mm long (not uncommon), I end up with 10,000 spectra. Each of these may have calibration data available so calibrations can get very large if I used every spectra (finding an appropriate approach to this type of calibration development is the challenge currently before me, with a small research budget.)

Thanks again for the quick and useful suggestions.
Top of pagePrevious messageNext messageBottom of page Link to this message

Howard Mark (hlmark)
Senior Member
Username: hlmark

Post Number: 468
Registered: 9-2001
Posted on Saturday, January 07, 2012 - 5:16 am:   

Ian - yes,I remember that.

BTW, on a related topic: when you asked for suggestions for updating the discussion group software, I don't recall if I mentioned adding a spell-checker. If I didn't and it's not too late, I hope you can consider that now.

\o/
/_\
Top of pagePrevious messageNext messageBottom of page Link to this message

Ian Michael (admin)
Board Administrator
Username: admin

Post Number: 36
Registered: 1-2006
Posted on Saturday, January 07, 2012 - 4:30 am:   

Howard,

A good point, and a tricky one! You may remember that we suffered from some inappropriate posts some years ago at which point I changed settings to ensure that I looked at each registation and approved or rejected it based on some simple questions. (And, of course, only registered users can post.) This has (famous last words!) prevented further problems. The same system should prevent malicious uploading of programs, but wouldn't necessarily protect against innocent errors around viruses or bad programming.

I don't have an immediate answer, but we should bear it in mind.

Ian
Top of pagePrevious messageNext messageBottom of page Link to this message

Scott Ramos (lsramos)
Junior Member
Username: lsramos

Post Number: 10
Registered: 1-2007
Posted on Friday, January 06, 2012 - 1:07 pm:   

Geoff,

You can also use the Pirouette demo program to load Bruker files, then export them in SPC format. This can be done as a batch operation so is pretty quick. No license required for file operations.

Scott
Top of pagePrevious messageNext messageBottom of page Link to this message

Howard Mark (hlmark)
Senior Member
Username: hlmark

Post Number: 466
Registered: 9-2001
Posted on Friday, January 06, 2012 - 12:36 pm:   

Ian - it's a good idea, but we should also think of how we can protect all the users of this repository from programs with bugs, or worse, with malware. We'd like to think that none of OUR users would do such things, but experience with the wider world of Internet says that that's not always the case.

In fact, I'm just now recovering from a computer virus I picked up even though I was using virus protection. Maybe I'm being too sensitive, but it really brings the problem home to me.

\o/
/_\
Top of pagePrevious messageNext messageBottom of page Link to this message

Ian Michael (admin)
Board Administrator
Username: admin

Post Number: 35
Registered: 1-2006
Posted on Friday, January 06, 2012 - 8:45 am:   

Sharing is an excellent idea. We already have a small �software archive� at http://www.impublications.com/content/nir-software-archive, and I would be happy to add to this. However, a better way would be for contributors to upload files themselves. I suggest that I create a new Forum �topic� called Software with sub-topics to help people find suitable code easily. I suppose the best way to organise this is by program (Opus, Unscrambler, Excel, Matlab etc.); do you agree?

We still intend to integrate this Forum more closely into the main website and could then create a better system (allowing for multiple classifications, for instance). However, we would have to restrict uploads to registered users (to prevent being used as a repository for �dodgy� files) and I imagine the last thing most people want is another login to remember!

Any comments/thoughts welcomed. We definitely would like to help facilitate this.

Ian
Top of pagePrevious messageNext messageBottom of page Link to this message

Julio Trevisan (lascanter2010)
Junior Member
Username: lascanter2010

Post Number: 7
Registered: 8-2010
Posted on Friday, January 06, 2012 - 7:58 am:   

Oh I didn't know we could post files.

Here is a macro to batch-process all files in one given directory.

I hope this is useful.

Julio
application/zipOPUS macro
mtx_juliotrevisan.zip (13.6 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Gordon Pfeiffer (gordon_pfeiffer)
New member
Username: gordon_pfeiffer

Post Number: 2
Registered: 11-2011
Posted on Friday, January 06, 2012 - 7:37 am:   

To the group: I didn't write the macro attached to this comment, it's from OPUS 5.5, in OPUS 6.5 it wasn't included anymore, but it still works fine.

Gordon



application/octet-stream
DIRtoSPC.MTX (5.7 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Julio Trevisan (lascanter2010)
Junior Member
Username: lascanter2010

Post Number: 6
Registered: 8-2010
Posted on Friday, January 06, 2012 - 7:32 am:   

Dusan,

Jacob Filik ([email protected]) wrote a routine to open single spectra, and Michael Nasse ([email protected]) wrote a routine to open images (i.e., multiple files). Since the licensing policies of their codes are not clear to me, I prefer if you either contact them directly, of allow me to introduce you to one of them once I have your e-mail (mine is [email protected]). Please let me know which is your case (single spectrum or image).

Best,

Julio
Top of pagePrevious messageNext messageBottom of page Link to this message

David Semmes (dsemmes)
Junior Member
Username: dsemmes

Post Number: 8
Registered: 6-2010
Posted on Friday, January 06, 2012 - 7:18 am:   

To the group: wouldn't it be nice if we could all somehow share OPUS macros? Does anyone know how we could easily accomplish that?

Thanks,

David
Top of pagePrevious messageNext messageBottom of page Link to this message

David Semmes (dsemmes)
Junior Member
Username: dsemmes

Post Number: 7
Registered: 6-2010
Posted on Friday, January 06, 2012 - 7:15 am:   

Dear Mr. Pfeiffer,

May I have a copy of your OPUS macro also? I've written some simple OPUS macros in the past - I hope to write more soon, and I'm sure your example would be helpful. My email address is in my profile.

Many thanks,

David
Top of pagePrevious messageNext messageBottom of page Link to this message

Dusan Kojic (dkojic)
New member
Username: dkojic

Post Number: 3
Registered: 7-2011
Posted on Friday, January 06, 2012 - 7:14 am:   

Julio,

I use matlab a lot so I'd like to take a look at those routines, since it would be easier to import opus files directly. Would you be kind enough to send them to me ?

Many thanks !
Dusan
Top of pagePrevious messageNext messageBottom of page Link to this message

Gordon Pfeiffer (gordon_pfeiffer)
New member
Username: gordon_pfeiffer

Post Number: 1
Registered: 11-2011
Posted on Friday, January 06, 2012 - 6:38 am:   

Dear Mr. Downes,

if you like I can send you the needed macro(s) to convert OPUS spectra to spc (complete directories/folders), I just need your email adress. if the macro crashes you should work in batches (eventually no more than 500 spectra at once).
Just open the menu 'macro' in OPUS, then 'start macro'. now choose the macro in a given location of your harddisk and follow the instructions (source- and destination-path etc.) It happens that the converted spectra still have the old OPUS-extension (*.0/1/2 etc). In this case use a rename-tool (like 'lupas rename' for multiple renaming operations) to fix that problem. just append the spc-extension.

After some trials it will work!

Kind Regards

Gordon Pfeiffer
Top of pagePrevious messageNext messageBottom of page Link to this message

Alisha (agnosus)
Member
Username: agnosus

Post Number: 15
Registered: 1-2009
Posted on Friday, January 06, 2012 - 6:05 am:   

Hi Geoff,
I am not familiar with R but if it can read the matrix of data (like matlab) you can stack up all the spectra in opus using 'assemble GC-file' function and then copy/paste the matrix of data directly into R.

Alternatively you can use unscrambler to read opus files and export to JCAMP-DX.

Alisha
Top of pagePrevious messageNext messageBottom of page Link to this message

Julio Trevisan (lascanter2010)
New member
Username: lascanter2010

Post Number: 5
Registered: 8-2010
Posted on Friday, January 06, 2012 - 5:08 am:   

Maybe I can help with this question. I have been working with OPUS files
myself for a while.

OPUS has a programming language where you can write a macro to
batch-process all the files in a directory and convert them to a more
suitable format. You can find at
http://biophotonics.lancs.ac.uk/software/macro/ a macro that I wrote myself
to cut-baselineCorrect-normalize and save as Pirouette .dat all the files
in a directory. It is easy to modify the macro for your own purpose.

OPUS is known to provide the specs for their file format on demand. I know
two different people who wrote routines to open OPUS files in MATLAB. I see
that you use R, but just in case I can give you more information if you are
interested in MATLAB.

Hope this helps!

Julio
Top of pagePrevious messageNext messageBottom of page Link to this message

Peter Tillmann (tillmann)
Senior Member
Username: tillmann

Post Number: 26
Registered: 11-2001
Posted on Friday, January 06, 2012 - 3:52 am:   

Morning Geoff,

I have asked my contact person at Bruker for a description of the OPUS file format. There is no official document to be published regarding the file format.

The only legal consequence seems to be the converter to SPC or JDX in OPUS. If you are running OPUS 6.5 you will miss the batch conversion, which was available in 5. 500 spectra are quickly converted.

The other solution is "reverse engineering". But it will take a lot of time, since the number of blocks are not uniform and "never" in the same sequence.


Peter
Top of pagePrevious messageNext messageBottom of page Link to this message

Geoff Downes (geoffd)
New member
Username: geoffd

Post Number: 1
Registered: 12-2011
Posted on Thursday, January 05, 2012 - 6:46 pm:   

Hi. as a new member to the forum I had a quick look and couldn't to see that the question has been asked already.

I want to read OPUS spectra collected on a Bruker MPA directly into R (statistical programming language). As I have thousands of spectra to process, I don't want to use the OPUS software to convert to spc or dpt format first as it is so slow.

Has anyone done this, or knows the format of the OPUS spectra?

Add Your Message Here
Posting is currently disabled in this topic. Contact your discussion moderator for more information.