Author Topic: Cutting a slice out of an image and saving it as text  (Read 20258 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Cutting a slice out of an image and saving it as text
« on: 2007 October 17 17:59:44 »
Hi,

sometimes it would be helpful to take some image data and process it in software like Excel for example. I would like to cut out a star and plot the signal strength in 3D, let's say. I can imagine a dynamic tool ala the dynamic cropping tool that lets you select a rectangular area of the image and then 'save as' or 'export' as .csv file for processing outside PCL.

Fv allows the export of entire FITS files to text and through a somewhat clumsy interface also sections but I'd rather keep it within PCL. Now if you want to add a 3D charting tool that plots a section of the image that would be nice too but that sounds several orders of magnitude more complex to do :-)

Best,

   Sander
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Cutting a slice out of an image and saving it as text
« Reply #1 on: 2007 October 17 18:27:12 »
Hi Sander

There are in our qeue list (the processes that needs some adjustments before publishing) two processes that goes somewhere near your suggestion. One of them draws a plot of pixel coordinates v/s intensity, for one dimension (row, column, or a user defined line). Alternativy plots radial coordinates (user defined center and radius) v/s intensity. The other one is a psf extractor, where I want to include a plot of current data compared to the fitted PSF.

About a 3D plot... I'm very interested in that, but my programming skills are far below for such task, so we'll have to wait untill Juan (or a third party programmer) implements it.


Now, about your first suggestion... this may be easyly done, but... it would be funnier for us to know what do you want to do with the data, and try to implement something that performs such task here :) PixInsight is a platform for a very wide range of applications, from simple jobs to state of the art image processing. I can't image somewhere better to "play" with your data ;) Seriusly talking, I would only export derivated data such as total flux and star coordinates, for example to perform photometry/astrometry, not raw pixel values.


Anyway, if you insist that you need pixel values written in a text file, I may build something simple. I mean, statically define a rectangle, select the output bitdeph/data sample, and a separator character.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Cutting a slice out of an image and saving it as text
« Reply #2 on: 2007 October 17 23:21:14 »
Hi Carlos,

I would use the data to plot a 3D or flat chart to show me how 'even' the star is. This would help my analyze image quality. It would show collimation for short exposures and guiding/drift quality for longer exposures. I imagine it wouldn't be hard to add a FWMH analysis to PCL but it would be interesting to take a small section and produce a 'mountain chart' in 3D to pick out luminance differences that are hard to see when it's all shades of grey. Alternatively you could assign different colors to different intensities to bring out these differences.

As you know you want your stars to be round with the max intensity in the middle. In the mean time I could easily crop an image down to just the star or section I want to analyze and then convert it to number with fv for import into Excel.  I imagine it wouldn't be hard to take the dynamic crop module and create a new version that would save the selected area as a csv file.

Best,

   Sander
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Cutting a slice out of an image and saving it as text
« Reply #3 on: 2007 October 18 08:42:04 »
Hi Sander

The process that calculates the FWHM (in fact, gives the centroid coordinates, standard deviation, fwhm, total flux, peak intensity, for simetrical profiles, while asimetric profiles calculates de same for both axis, and the rotation angle) is almost ready. We had some minor problems with the angle rotation calculation for asimetric profiles. It also lacks the comparison plot that I menctioned earlier.

About the false color suggestion, count on that. I'll add it to my to do list.


Finally, the 3D plot... let's see what Juan says.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Cutting a slice out of an image and saving it as text
« Reply #4 on: 2007 October 18 08:59:58 »
Very ambitious Carlos, sounds exciting!

As a general comment it's probably a good idea to have some kind of export function like what I'm suggesting because there will always be someone like me who wants the numbers to do their own thing. It's a matter of being future-proof.

Best,

  Sander
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Cutting a slice out of an image and saving it as text
« Reply #5 on: 2007 October 18 09:48:56 »
Yes, I agree with you, ***but*** don't forget that PixInsight is not a image processing software like others.... it is better defined as a platform, with open architecture. Users may freely (and relatively simple) build their own modules, and there is a huge way to work with the data with the scripting capabilities. You already may see some complex scritp codes published in the forum, where even graphical user interfases are defined. In that sense, just to make a comparation, PixInsight is much closer to Matlab than to Photoshop. So, I hope you'll understand why I'll try to encourage users to exploid those capabilities instead of importing such data to other softwares.

I'm not saying that we'll not consider your suggestion to export pixel values to a text file... but I'm sure that in most cases we'll figure out how to perform those tasks right here. A different story is derived data like star coordinates.


By the way, a note just to avoid confusions. We call PCL to the collection of libraries that allows users to build theyr own modules, the PixInsight Class Library. The PixInsight application, by the other hand, may be just abbreviated PI, or "core" if you are talking about something not related to any module.
And a second by the way, indeed the FWHM routine will be incorporated inside the PCL, and a process that makes uses of it will be included as a module for PI. ;)


Thank you very much for all your interest in our project. Guys like you makes us keep going :)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Cutting a slice out of an image and saving it as text
« Reply #6 on: 2007 October 18 09:59:50 »
Hi Carlos,

thanks for the clarification on what is called what. That makes communication much clearer :-)

I understand the power of PI compared to other imaging software. Having the full capabilities of the product available as Java classes for scripting is very powerful. Of course there is lots of precedent for that, PaintShopPro, MS Office, OpenOffice and many other applications do the same. I've never used Photo Shop so I don't know if it has a scripting interface.

Continued good luck with the project,

   Sander
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Cutting a slice out of an image and saving it as text
« Reply #7 on: 2007 October 18 12:40:24 »
Javascript, please ;). It has nothing to do with java (fortunately! :)).
--
 David Serrano