Import a HiRISE DTM formatted as a PDS IMG file #24897

Closed
opened 2010-11-24 22:13:09 +01:00 by Tim Spriggs · 15 comments
Member

Project: Blender Extensions
Tracker: Py Scripts Release
Blender: 2.64
Script name: Import HiRISE DTM from PDS IMG
Wiki page: http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/File_I-O/HiRISE_DTM_from_PDS_IMG
Author(s): Tim Spriggs
Category: Import Export
SVN Download: https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/io_convert_image_to_mesh_img/
Status: Open
Related: 25462

%%%Features

  • can import a .IMG file with a PDS label in the beginning
  • perform down sampling via averaging of large images to work faster in development
    • 2x2, 6x6, 12x12
  • perform down sampling via single sample (faster import)
    • 6x6, 12x12
  • scale the mesh on import

Setup

  1. download init.py and import_img.py
  2. place them into a new directory named "io_mesh_img" inside of the standard "scripts/op" directory.
  3. start blender

Manual

  1. choose a published HiRISE DTM from http://www.uahirise.org/dtm/
  2. download the linked "DTM" image (Warning: these files can be quite large)
  (example URL below for the lazy)
  1. Inside of Blender navigate: File -> Import -> HiRISE DTM from PDS IMG (*.IMG)
  2. Select the DTM you downloaded
  3. Select your bin/scale settings. The defaults should be reasonable for decent resolution.
    • see binning method explanations below
  4. Select the "Import HiRISE DTM" button to start the import
  5. Wait.
  6. Enjoy/manipulate/render the surface of mars as you would any other mesh in Blender.
Example IMG file:

http://www.uahirise.org/PDS/DTM/PSP/ORB_006800_006899/PSP_006899_1330_PSP_006965_1330/DTEEC_006899_1330_006965_1330_U01.IMG

Binning Methods:

None: This will import the DTM without downsampling. Warning: this can take a lot of memory.

2x2: create one value for each 2x2 region of the DTM by averaging them
6x6: create one value for each 6x6 region of the DTM by averaging them
6x6 Fast: create one value for each 6x6 region of the DTM by sampling a single value
12x12: create one value for each 12x12 region of the DTM by averaging them
12x12 Fast: create one value for each 12x12 region of the DTM by sampling a single value

12x12 is best for initial development of a scene to create very fast renders.
6x6 is better for proofing and even final products
2x2 is good for using a lot of CPU hours
None is good for small DTMs or computers built after 2015

Notes:

This module should import DTMs from projects other than HiRISE created as .IMG files for a PDS release but may not be well tested.%%%
**Project**: Blender Extensions **Tracker**: Py Scripts Release **Blender**: 2.64 **Script name**: Import HiRISE DTM from PDS IMG **Wiki page**: http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/File_I-O/HiRISE_DTM_from_PDS_IMG **Author(s)**: Tim Spriggs **Category**: Import Export **SVN Download**: https://svn.blender.org/svnroot/bf-extensions/trunk/py/scripts/addons/io_convert_image_to_mesh_img/ **Status**: Open **Related**: 25462 %%%Features - can import a .IMG file with a PDS label in the beginning - perform down sampling via averaging of large images to work faster in development - 2x2, 6x6, 12x12 - perform down sampling via single sample (faster import) - 6x6, 12x12 - scale the mesh on import Setup 1) download __init__.py and import_img.py 2) place them into a new directory named "io_mesh_img" inside of the standard "scripts/op" directory. 3) start blender Manual 1) choose a published HiRISE DTM from http://www.uahirise.org/dtm/ 2) download the linked "DTM" image (Warning: these files can be quite large) ``` (example URL below for the lazy) ``` 3) Inside of Blender navigate: File -> Import -> HiRISE DTM from PDS IMG (*.IMG) 4) Select the DTM you downloaded 5) Select your bin/scale settings. The defaults should be reasonable for decent resolution. - see binning method explanations below 6) Select the "Import HiRISE DTM" button to start the import 7) Wait. 8) Enjoy/manipulate/render the surface of mars as you would any other mesh in Blender. ``` Example IMG file: ``` http://www.uahirise.org/PDS/DTM/PSP/ORB_006800_006899/PSP_006899_1330_PSP_006965_1330/DTEEC_006899_1330_006965_1330_U01.IMG Binning Methods: ``` None: This will import the DTM without downsampling. Warning: this can take a lot of memory. ``` 2x2: create one value for each 2x2 region of the DTM by averaging them 6x6: create one value for each 6x6 region of the DTM by averaging them 6x6 Fast: create one value for each 6x6 region of the DTM by sampling a single value 12x12: create one value for each 12x12 region of the DTM by averaging them 12x12 Fast: create one value for each 12x12 region of the DTM by sampling a single value 12x12 is best for initial development of a scene to create very fast renders. 6x6 is better for proofing and even final products 2x2 is good for using a lot of CPU hours None is good for small DTMs or computers built after 2015 Notes: ``` This module should import DTMs from projects other than HiRISE created as .IMG files for a PDS release but may not be well tested.%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

This task was automatically closed as archived as part of migration, because it was determined to be no longer active.

The authoritative list of addons is on the wiki, we no longer have a report for each addon to track bugs and updates. Bugs can be reported individually and assigned to the addon developers. See the #Addons project page for more information on the workflow.

This task was automatically closed as archived as part of migration, because it was determined to be no longer active. The authoritative list of addons is on the wiki, we no longer have a report for each addon to track bugs and updates. Bugs can be reported individually and assigned to the addon developers. See the #Addons project page for more information on the workflow.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Author
Member

%%%I was given a kind hint in IRC:

14:28 < mindrones> rootard_ woo cool :) it's not an addons tho
14:28 < rootard_> ?
14:29 < mindrones> rootard_ to be an addon it has to go in addons/ folder so that it cna be enabled/disabled at will
14:29 < mindrones> rootard_ like it is now it simply is in blender by default
14:30 < mindrones> rootard_ have a look at scripts in addons/
14:33 < rootard_> mindrones: k, so I need the bl_addon_info dict... I'll rework some of it.
14:35 < mindrones> rootard_ yeps, also, have a read at http://wiki.blender.org/index.php/Dev:Py/Sharing

... so I reworked it and tested. Now the updated script should go into "addons/io_mesh_img" instead of "scripts/op/io_mesh_img"%%%

%%%I was given a kind hint in IRC: 14:28 < mindrones> rootard_ woo cool :) it's not an addons tho 14:28 < rootard_> ? 14:29 < mindrones> rootard_ to be an addon it has to go in addons/ folder so that it cna be enabled/disabled at will 14:29 < mindrones> rootard_ like it is now it simply is in blender by default 14:30 < mindrones> rootard_ have a look at scripts in addons/ 14:33 < rootard_> mindrones: k, so I need the bl_addon_info dict... I'll rework some of it. 14:35 < mindrones> rootard_ yeps, also, have a read at http://wiki.blender.org/index.php/Dev:Py/Sharing ... so I reworked it and tested. Now the updated script should go into "addons/io_mesh_img" instead of "scripts/op/io_mesh_img"%%%

%%%assigning to stiv, see below :)

I work for HiRISE and I'm tired of not being able to view an actual DTM without a $50k piece of software that is a pain in the butt to work with anyway :)
I also figure that making the data easy for blender artists to use will result in cool fly throughs someday :)
DTM ?
Digital Terrain Model. (Also the term DEM is thrown around: s/Terrain/Elevation/)
examples: http://www.uahirise.org/dtm/
ah. that would have been my guess, coming from a GIS background, but figured it was something else
rootard, cool pix!
stiv, thanks! I'll pass it on to the folks upstairs.
in addition to gis, /me also has a thing for mars
stiv: that's great. With this plugin you can import surface models of Mars at 1m resolution if you have the memory for it. ;)
rootard, cool! a major savings on airfare! are these data sets specific to hirise?

  • stiv admits to not having followed the discussion
    There is another Mars project in the works (HiSCI) that will only produce stereo imagery and will likely use the same format. Also LRO uses the same .IMG format so you can probably get DTMs of the Moon and bring them in as well.
    hey stiv maybe you haev time/will to review this one?
    stiv you seem to have one with approriate background :)
    mindrones, I'll try to take a look at it
    stiv can I assign to you?
    mindrones, sure. go ahead. time to step up my involvement again
    stiv and wow! :)
    %%%
%%%assigning to stiv, see below :) <rootard> I work for HiRISE and I'm tired of not being able to view an actual DTM without a $50k piece of software that is a pain in the butt to work with anyway :) <rootard> I also figure that making the data easy for blender artists to use will result in cool fly throughs someday :) <stiv> DTM ? <rootard> Digital Terrain Model. (Also the term DEM is thrown around: s/Terrain/Elevation/) <rootard> examples: http://www.uahirise.org/dtm/ <stiv> ah. that would have been my guess, coming from a GIS background, but figured it was something else <stiv> rootard, cool pix! <rootard> stiv, thanks! I'll pass it on to the folks upstairs. <stiv> in addition to gis, /me also has a thing for mars <rootard> stiv: that's great. With this plugin you can import surface models of Mars at 1m resolution if you have the memory for it. ;) <stiv> rootard, cool! a major savings on airfare! are these data sets specific to hirise? * stiv admits to not having followed the discussion <rootard> There is another Mars project in the works (HiSCI) that will only produce stereo imagery and will likely use the same format. Also LRO uses the same .IMG format so you can probably get DTMs of the Moon and bring them in as well. <mindrones> hey stiv maybe you haev time/will to review this one? <mindrones> stiv you seem to have one with approriate background :) <stiv> mindrones, I'll try to take a look at it <mindrones> stiv can I assign to you? <stiv> mindrones, sure. go ahead. time to step up my involvement again <mindrones> stiv and wow! :) %%%

%%%Help, I think my computer melted!

Downloaded the (400+ Mb) example file and ran the script. Seems to work as advertised.

A quick pass over the code does not show anything scary. The import * thing is generally frowned on, but minor.

The only suggestions I might make are to set the default bin size 12x12 so the unwary don't end up with a box of melted silicon and maybe a note in the warning header about being resource intensive.

Bottom line: seems like Good Stuff!%%%

%%%Help, I think my computer melted! Downloaded the (400+ Mb) example file and ran the script. Seems to work as advertised. A quick pass over the code does not show anything scary. The import * thing is generally frowned on, but minor. The only suggestions I might make are to set the default bin size 12x12 so the unwary don't end up with a box of melted silicon and maybe a note in the warning header about being resource intensive. Bottom line: seems like Good Stuff!%%%
Author
Member

%%%Hi Stephen,

Thanks for the suggestion. I set the default import to 12x12 fast so that the default is a quick preview and should take as few resources as possible while still showing the large features of a HiRISE DTM.
Just as a quick reference to those interested, a 12x12 fast import of a 614MB .IMG file takes around 2 minutes to load and Blender reports 96.53MB of memory used on a 32-bit Intel MacBook Pro (1.83 Ghz/2GB DDR2 memory) with all other settings at factory defaults.
I have uploaded a .zip file which is easier to install from the user preferences panel. I will update the wiki shortly.

Thanks,

  • Tim%%%
%%%Hi Stephen, ``` Thanks for the suggestion. I set the default import to 12x12 fast so that the default is a quick preview and should take as few resources as possible while still showing the large features of a HiRISE DTM. ``` ``` Just as a quick reference to those interested, a 12x12 fast import of a 614MB .IMG file takes around 2 minutes to load and Blender reports 96.53MB of memory used on a 32-bit Intel MacBook Pro (1.83 Ghz/2GB DDR2 memory) with all other settings at factory defaults. ``` ``` I have uploaded a .zip file which is easier to install from the user preferences panel. I will update the wiki shortly. ``` Thanks, - Tim%%%
Author
Member

%%%13:25 < stiv> rootard, if you have stuff you need committed, add it as a patch to the tracker ticket and I

            (or someone) can commit it

I don't see how to attach files in the current invocation of the tracker so I have posted the patch here:

http://pirlwww.lpl.arizona.edu/~tims/io_convert_image_to_mesh_img.patch

Thanks!%%%

%%%13:25 < stiv> rootard, if you have stuff you need committed, add it as a patch to the tracker ticket and I ``` (or someone) can commit it ``` I don't see how to attach files in the current invocation of the tracker so I have posted the patch here: http://pirlwww.lpl.arizona.edu/~tims/io_convert_image_to_mesh_img.patch Thanks!%%%

%%%Moved from Py Scripts Upload to Py Scripts Release%%%

%%%Moved from Py Scripts Upload to Py Scripts Release%%%

%%%Hi, noting here the structure of the merger package we spoke about in irc with Valter:

io_convert_image_to_mesh_pds/
init.py
hirise/
init.py
import_img.py
lola_mola/
init.py
import_lro_mro.py%%%

%%%Hi, noting here the structure of the merger package we spoke about in irc with Valter: io_convert_image_to_mesh_pds/ __init__.py hirise/ __init__.py import_img.py lola_mola/ __init__.py import_lro_mro.py%%%
Member

%%%Hi!
Since your script is now in bf-extensions' svn (contrib|trunk) we have deleted the current attachments to avoid that end-users could reach this page and get the wrong version of your script.
Note that your script may have api changes or small maintenence changes applied in SVN.
Please retrieve your script from SVN before updating SVN to avoid mis-versioned scripts.
Thanks!
%%%

%%%Hi! Since your script is now in bf-extensions\' svn (contrib|trunk) we have deleted the current attachments to avoid that end-users could reach this page and get the wrong version of your script. Note that your script may have api changes or small maintenence changes applied in SVN. Please retrieve your script from SVN before updating SVN to avoid mis-versioned scripts. Thanks! %%%
Member

%%%Hi,
Due to changes to the api including the merging of bmesh, several addons are outdated.
Please, if you are the author of an addon check your script with blender revision 44256 or newer.
That is builds made After blender 2.62 official release.
I would ask that updates be made to your addon before the Blender 2.63 release.
6-8 weeks away.
This allows time for the api to become more exposed & bmesh to stablize furthur.
If you need help, drop into irc freenode #blenderpython or #blendercoders & feel welcome to ask questions.
At the time of 2.63 release, scripts that are not repaired or in active developement will have their tracker page marked "Closed"
this will not affect your links to the tracker, similar to closing scripts in 2.49b, the page will be still availible & can be re-opened.

Thanks for your understanding & patience during these Exciting Times.
Brendon.

%%%

%%%Hi, Due to changes to the api including the merging of bmesh, several addons are outdated. Please, if you are the author of an addon check your script with blender revision 44256 or newer. That is builds made After blender 2.62 official release. I would ask that updates be made to your addon before the Blender 2.63 release. 6-8 weeks away. This allows time for the api to become more exposed & bmesh to stablize furthur. If you need help, drop into irc freenode #blenderpython or #blendercoders & feel welcome to ask questions. At the time of 2.63 release, scripts that are not repaired or in active developement will have their tracker page marked "Closed" this will not affect your links to the tracker, similar to closing scripts in 2.49b, the page will be still availible & can be re-opened. Thanks for your understanding & patience during these Exciting Times. Brendon. %%%

Added subscriber: @phaseIV-3

Added subscriber: @phaseIV-3

If anyone reads this, the functionality of the Hirise DTM importer has been restored.
The updated addon can be found at https://github.com/phaseIV/Blender-Hirise-DTM-Importer

If anyone reads this, the functionality of the Hirise DTM importer has been restored. The updated addon can be found at https://github.com/phaseIV/Blender-Hirise-DTM-Importer

Very timely with the current interest in Mars. I will check it out.
Thanks.

Very timely with the current interest in Mars. I will check it out. Thanks.
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#24897
No description provided.