Sciencemadness Discussion Board
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: Spectral Image To "Raw" Data
smaerd
International Hazard
*****




Posts: 1262
Registered: 23-1-2010
Member Is Offline

Mood: hmm...

[*] posted on 13-5-2015 at 05:15
Spectral Image To "Raw" Data


Problem/Why:
So I ran into a pretty huge issue the other week. I was left in a situation where I did not have access to the raw data of an FT-IR spectra but had images of it. I needed peak locations and the graduations on the spectra were not fine at all.

After not being able to find a soft-ware suite to open the raw data files I had, I knew I was in a bad spot. My report was due in a couple days. I found soft-ware/free-ware that could convert 'some' images back into data, but they lacked the ability to do this with spectra (too complicated I think?). Necessity is the mother of invention I guess.
------------------------------
Solution:
I wrote a program (has a few flaws and pretty limited) in JAVA to turn these images into CSV (comma separated value files) which nearly any serious soft-ware suite can access and retrieve values from.

If anyone else finds themselves in a similar spot I will provide the source code (attached). This same type of algorithm could work for things like UV-VIS, or 1D NMR.

screenshot.jpg - 311kB


The code currently assumes a few things...
1. The background color of the spectra is white, the boundaries/graduations are in black
2. The spectra/data set is in another color which can be specified by RGB minimum and maximum values
3. The boundaries of the spectra can be found at exactly half its height and width (IE: there are no graduations or text preceeding these locations).
4. That only the minimum and maximum y values at any given X value matters

I will admit, the data doesn't come out exactly how it looks in the image, with very fine transitions and large zooming things get a little buggy but, the peak locations remain solid as far as I have seen. I can think of a few ways to fix several flaws in the algorithm, but I no longer need the program. So I figured I would open the project up to the community.

It could help someone out of a jam! It definitely saved my ass... In true open source fashion here ya go:

Source:
------------------------
Attachment: ChartReadGUISwing.java (10kB)
This file has been downloaded 325 times


[Edited on 13-5-2015 by smaerd]




View user's profile View All Posts By User
m1tanker78
International Hazard
*****




Posts: 685
Registered: 5-1-2011
Member Is Offline

Mood: No Mood

[*] posted on 13-5-2015 at 15:57


I've been in a similar jam before. Nice thinking-outside-the-box solution to the problem. What's the format of the original image file?



Chemical CURIOSITY KILLED THE CATalyst.
View user's profile View All Posts By User
smaerd
International Hazard
*****




Posts: 1262
Registered: 23-1-2010
Member Is Offline

Mood: hmm...

[*] posted on 13-5-2015 at 17:08


The original file format is a .bmp file. Which was a copy and paste of an OLE object that I had dragged into a powerpoint presentation (how I typically mass transfer FT-IRs). Thanks, it was the only thing that I could think to do.

[Edited on 14-5-2015 by smaerd]




View user's profile View All Posts By User
Chemosynthesis
International Hazard
*****




Posts: 1071
Registered: 26-9-2013
Member Is Offline

Mood: No Mood

[*] posted on 15-5-2015 at 17:33


Pretty impressive. Even though I don't see myself requiring this type of code anymore, I am glad to see it.
View user's profile View All Posts By User
AnthonyLip
Harmless
*




Posts: 1
Registered: 20-12-2018
Member Is Offline


[*] posted on 20-12-2018 at 11:22
Vinhomes launches VinCity Sportia project


[img]http://image.vietnamnews.vn//uploadvnnews/Article/2018/12/4/Anh2121114032AM.jpg[/img]
VinCity Sportia is the second project launched in HA NOI under the VinCity brand this year. — Photo courtesy of Vingroup
Viet Nam News
HA NOI — Vinhomes Joint Stock Company, a member of property developer Vingroup, officially launched the VinCity Sportia project on Tuesday.
Developed from the dynamic sports city concept of "Singapore and beyond," VinCity Sportia is one of the most modern and dynamic outdoor sports complexes in Viet Nam.
The project is located at the axis of Thăng Long Avenue, in the area of Tây Mo - Đại Mo Ward. It covers 280 hectares; however, the construction density is only 14.7 per cent.
VinCity Sportia spends most of its space to develop public facilities including the largest outdoor sports park in Việt Nam with more than 1,000 gym machines, eight utility parks, 200 outdoor sports fields, eight indoor and outdoor swimming pools, more than 60 children’s playgrounds and 58 relaxing hubs with gardens and walking paths.
VinCity also owns a comprehensive system of education, health, entertainment and leisure facilities in accordance with Singaporean standards, including an education system from kindergarten to multidisciplinary school including Vinschool, Vinmec International Hospital, Vincom Centres, crowded commercial streets and three BBQ parks.
VinCity Sportia will also be managed in accordance with VinCity standards from Vinhomes investor to maintain the best environment and facilities. In particular, the security system includes security cameras, a secure elevator using resident cards and a fire safety system with shelters and fire doors.
In order to make the urban model of "Singapore and beyond" more accessible to the population, Vinhomes and Techcombank have combined to offer a financial solution for customers. Accordingly, customers buying in VinCity Sportia receive maximum financial support. With only 10 per cent of the apartment price, customers can sign a sale contract. The next 20 per cent are paid gradually over six months after signing the sale contract, and for the remaining 70 per cent customers are entitled to a 35-year loan. The payment is only several million VNĐ per month.
VinCity Sportia is the second project launched in HA NOI in 2018 under the VinCity brand. Modern and convenient, the outstanding point of the VinCity model is the large ecological space, honouring healthy lifestyles and the balance between an active lifestyle and nature. — VNS

[url=https://vincity.bacvilla.com]vincity[/url]
[url=https://vincity.bacvilla.com]vincity sportia[/url]
View user's profile View All Posts By User

  Go To Top