taskGNU Astronomy Utilities - Tasks: task #14364, Add --size as an option to...


You are not allowed to post comments on this tracker with your current authentication level.

task #14364: Add --size as an option to ImageWarp as an alternative to --scale

Submitter:  Lee Kelvin <leeskelvin>
Submitted:  Wed 08 Feb 2017 08:21:45 PM UTC
Should Start On:  Wed 08 Feb 2017 12:00:00 AM UTC Should be Finished on:  Wed 08 Feb 2017 12:00:00 AM UTC
Category:  Warp Priority:  5 - Normal
Item Group:  New feature Status:  None
Privacy:  Public Assigned to:  None
Percent Complete:  0% Open/Closed:  Open
Effort:  0.00

Jump to the original submission

Thu 19 Mar 2020 12:38:52 AM UTC, comment #6: 

In principle this task goes like this:

  1. you take the original image size (from `p->input->dsize[0]' and `p->input->dsize[1]').
  2. apply the final matrix to its edges (to see how large the final/rectangular box hosting the warped image will be).
  3. Calculate the necessary scaling matrix to apply to the original matrix (what ever combination of warping it is).

With these steps, the final output image box becomes exactly the size that is requested by this option.

About the question of image format: If you look in `bin/warp/ui.c', you'll notice that it uses the gal_array_read_one_ch_to_type function to load the input into memory. This high-level function can even load single color channels of JPEG images as well as FITS images! So the details of the file-format are abstracted into Gnuastro's data container (gal_data_t), so you don't have to worry about it :-).

Mohammad Akhlaghi <makhlaghi>
Group administrator
Wed 18 Mar 2020 11:56:47 PM UTC, comment #5: 

I was thinking of a solution to this task and inspecting the warp code and I have few questions.
should the --size and the --resolution be implemented like --scale and other modular warpings using an affine transformation ? if so does the input file have a specific format (is fits the only format or there are others)

Thu 09 Feb 2017 02:22:23 PM UTC, comment #4: 

Hi Mohammad,

Mostly I do not address comments to a particular person. The only exception to that is if I particularly want to address one of their points directly!

I will seek to change my comment writing style to suit... Forces of habit die hard. :)

Lee Kelvin <leeskelvin>
Thu 09 Feb 2017 12:47:51 PM UTC, comment #3: 

That sounds reasonable, then we will stick to `--size' and `--resolution' then. Thanks for the comment.

Just as a side note, I think it would be better if we don't use letter-style greetings (at the start and end of a comment) in the posts on Savannah. This is a public discussion and we don't want it to be only between two people. When you address the comment to a particular person, other interested people on the list will be discouraged from joining reading the post (when it goes in their emails especially).

For the end of the comment, writing our name is also redundant because the author's name is kept on the left side of the post on Savannah (and as the author in the mailing list archives). So when all the people don't add their names, it just makes going up or down through the comments a little harder (too much white space after some posts and not after the others). Requiring everyone to add their name would be too much and would just make the Savannah comments longer, so I think the better option is that people don't write their names in the end of each post.

Thanks again for all the great suggestions and discussions...

Mohammad Akhlaghi <makhlaghi>
Group administrator
Thu 09 Feb 2017 12:33:11 PM UTC, comment #2: 

Hi Mohammad,

Just a small point, if you change the name from '--size' to '--tosize' it becomes inconsistent with other arguments which do not currently have a preposition. For example, scaling an image is not currently '--byscale'.

To maintain consistency, either all arguments should contain a preposition or none should.


Lee Kelvin <leeskelvin>
Thu 09 Feb 2017 02:27:18 AM UTC, comment #1: 

This is a great suggestion, it is very useful.

Maybe just a change of name to `--tosize' would be less ambiguous.

Building on this great suggestion, I also suggest having a `--toresolution' option, so the user can specify the output image WCS resolution without having to check the input's resolution.

If anyone is interested in implementing this, please post a comment here and I would be happy to help ;-)...

Mohammad Akhlaghi <makhlaghi>
Group administrator
Wed 08 Feb 2017 08:21:45 PM UTC, original submission:  

In order to scale an image using ImageWarp one must currently provide a scaling value using the --scale argument. If a user wishes to scale an image to a particular output size, this necessitates that they also know the input size such that they can calculate the scaling value.

I propose the addition of a --size argument to ImageWarp which will allow the user to specify an exact output pixel size without needing to calculate the scaling value beforehand. This will speed up image processing for many users, and provides another quick means by which users may scale their imaging data.

Best regards,
Lee Kelvin

Lee Kelvin <leeskelvin>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by baha (Posted a comment)
  • -email is unavailable- added by makhlaghi (Posted a comment)
  • -email is unavailable- added by leeskelvin (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code