Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - EFV

#1
That is interesting.  I would have expected something like overlap reduction to segment the data (much like immerge) and run multithreaded.

My work computer (with 8x 2ghz processors) feels bottlenecked on a lot of short operations, but the longer jobs usually finish quickly.
#2
IMAlign / Re: Keep Best Line Data
April 08, 2009, 11:08:12 AM
The changes made by keep best line data shouldn't be "permanent."  As far as I know there should always be copies of the data saved to the workspace itself (under 3D digitized datasets in the workspace treeview).

As for the data in the align project, I can't confirm it right now, but the command EDIT RECOVER_DELETED_ELEMENTS should restore the data of selected scans no matter how the data was removed.  I know this works for reduce overlap, but I can't imagine keep best line data is any different.

I recommend using:

select all
edit recover_deleted_elements
select invert


This lets you see easily which elements were brought back by the operation.

As for using the function often.. well, whenever I have a project with lots of line scans (a lot would be several hundred to 1000+) and plenty of overlap I would use it.

The point, as I gather it, is to reduce the workload for IMMerge.  There shouldn't be a need for it if your merges go smoothly.
#3
This is an excellent idea.  Silly me, I never even considered doing extensive read/writes outside of polyworks.

I'm going to have to use this.
#4
I spent a couple of weeks curious about this, and had task manager open on my second monitor for many hours.

There seemed to be more activity during processes like alignment - every processor kicks in for that.  Your IMMerge agent governs merging, but with it turned off (or if on, configured to use all) all processors will take up work on that as well.

As far as I can tell, though, for most of the shorter jobs, a single powerful processor will do work faster than a mid-range multicore.

I haven't really paid attention to how v11 behaves in this regard.

*EDIT* - If polyworks does have some manual configuration/settings to improve multicore performance, it would be news to me.
#5
I don't know about exporting to text/IGS and importing those files, but you can import primitives directly from the IMInspect project.


  • File - Import Objects - From IMInspect project...
  • Choose the project with the desired circle(s) and click the Import button
  • Select the circle(s) you wish to import, click import
  • Define a tolerance, and click OK

The circles are brought in as curves.  I hope this accomplishes what you needed.
#6
Macro World / Re: Tab through images
March 31, 2009, 10:51:00 AM
Yeah, it's useful for cleaning noise and removing targets on images I get from the Breuckmann stereo scan that I usually use.

I only posted it because it's one of those macros that I put together and find myself using all the time.

I *think* you could adapt it to cycle through subgroups in much the same way.

Yep, it looks like you can use TREEVIEW SUBGROUP GET_NB/SELECT to create boundaries; TREEVIEW IMAGE GET_NB_SELECTED to verify group sizes (detect subgroup changes - though saving a list of image names for each subgroup and comparing them every time would be more accurate); but I don't anticipate a great need for quick swapping between subgroups like that.
#7
Macro World / Tab through images
March 30, 2009, 06:55:55 AM
This is a set of four macros that work together to add new functionality to polyworks.  It's not as exciting as that sentence made it sound. (*EDIT* I hate the way this sounds now.  Also, it's not exactly true - the functionality is there, just in longer processes.  duh)

What it allows me to do is press, for example, '+' and '-' to move back and forth through the images in my align project.  I can also press, say, '*' to KEEP the scan at which my + or - key last brought me.  Finally, I can press 'k' to set my index to the current selected scan and KEEP that scan.

Enough with the chatter, here's the code:


version "4.0"
declare eList "FIRST"
declare eIndex 1
declare ei 1
declare eTemp
declare eFailed 0
declare eTN

MACRO SHARED_VARIABLE GET_VALUE("eSharedImages", eList)
MACRO SHARED_VARIABLE GET_VALUE("eSharedImageIndex", eIndex)

    TREEVIEW IMAGE GET_NB(eTemp)

if $eList == "FIRST"
    while $ei <=$eTemp
        TREEVIEW IMAGE GET_NAME($ei, eList[$ei])
        ++ ei
    endwhile
    set eIndex 1
    VIEW VISIBILITY OBJECTS KEEP($eList[$eIndex])
    MACRO SHARED_VARIABLE CREATE("eSharedImages", $eList)
    MACRO SHARED_VARIABLE CREATE("eSharedImageIndex", $eIndex)
else
    #check list against treeview
   
    if size(eList) != $eTemp
        set eFailed 1
       
    else
        while $ei <= $eTemp
            TREEVIEW IMAGE GET_NAME($ei, eTN)
            if $eList[$ei] != $eTN
                set eFailed 1
            endif
            ++ ei
        endwhile
    endif
   
    if $eFailed == 1
        set ei 1
        set eList { "" }
        while $ei <=$eTemp
            TREEVIEW IMAGE GET_NAME($ei, eList[$ei])
            ++ ei
        endwhile
        set eIndex 1
    else
        ++ eIndex
    endif
   
    if $eIndex > $eTemp
        set eIndex 1
    endif
   
    VIEW VISIBILITY OBJECTS KEEP($eList[$eIndex])
    MACRO SHARED_VARIABLE SET_VALUE("eSharedImages", $eList)
    macro SHARED_VARIABLE SET_VALUE("eSharedImageIndex", $eIndex)
endif


This builds a list of the images in the current project and checks this list against a shared variable's contents.  If they don't match, the shared variable gets overwritten.  It then saves an index of the current image and, if the lists matched, increments the index by 1 - allowing you to scroll through your images.

This next macro does the same thing, except it scrolls backwards through the images:

version "4.0"
declare eList "FIRST"
declare eIndex 1
declare ei 1
declare eTemp
declare eFailed 0
declare eTN

MACRO SHARED_VARIABLE GET_VALUE("eSharedImages", eList)
MACRO SHARED_VARIABLE GET_VALUE("eSharedImageIndex", eIndex)

    TREEVIEW IMAGE GET_NB(eTemp)

if $eList == "FIRST"
    while $ei <=$eTemp
        TREEVIEW IMAGE GET_NAME($ei, eList[$ei])
        ++ ei
    endwhile
    set eIndex 1
    VIEW VISIBILITY OBJECTS KEEP($eList[$eIndex])
    MACRO SHARED_VARIABLE CREATE("eSharedImages", $eList)
    MACRO SHARED_VARIABLE CREATE("eSharedImageIndex", $eIndex)
else
    #check list against treeview
   
    if size(eList) != $eTemp
        set eFailed 1
       
    else
        while $ei <= $eTemp
            TREEVIEW IMAGE GET_NAME($ei, eTN)
            if $eList[$ei] != $eTN
                set eFailed 1
            endif
            ++ ei
        endwhile
    endif
   
    if $eFailed == 1
        set ei 1
        set eList { "" }
        while $ei <=$eTemp
            TREEVIEW IMAGE GET_NAME($ei, eList[$ei])
            ++ ei
        endwhile
        set eIndex 1
    else
        -- eIndex
    endif
   
    if $eIndex < 1
        set eIndex $eTemp
    endif
   
    VIEW VISIBILITY OBJECTS KEEP($eList[$eIndex])
    MACRO SHARED_VARIABLE SET_VALUE("eSharedImages", $eList)
    macro SHARED_VARIABLE SET_VALUE("eSharedImageIndex", $eIndex)
endif


Both have a check in place so scrolling beyond the first or last image will place you at the opposite end of the list.  The next two macros were created a couple weeks later, when I got fed up with scroll up then down again to return to my indexed image.


version "4.0"
declare eIndex
declare eList "FIRST"

MACRO SHARED_VARIABLE GET_VALUE("eSharedImageIndex", eIndex)
MACRO SHARED_VARIABLE GET_VALUE("eSharedImages", eList)

if $eList == "FIRST"
    ECHO ("An image list must be initialized to use this macro")
else
    VIEW VISIBILITY OBJECTS KEEP($eList[$eIndex])
endif


This one just keeps the image that you last scrolled to.  Simple.  Granted, it doesn't have the check to see if the treeview had changed, so it isn't perfect.  Adding something like this would fix it:

    #check list against treeview
   
    if size(eList) != $eTemp
        set eFailed 1
       
    else
        while $ei <= $eTemp
            TREEVIEW IMAGE GET_NAME($ei, eTN)
            if $eList[$ei] != $eTN
                set eFailed 1
            endif
            ++ ei
        endwhile
    endif
   
    if $eFailed == 1
        macro end
    endif


Of course, this isn't complete (you would need to declare and fill many of the variables here), but the idea is there.

This last macro keeps the current selected scan, and sets your index/image list to match it.  This is good for defining a starting point.


version "4.0"
declare eList "FIRST"
declare eIndex 1
declare ei 1
declare eTemp
declare eFailed 0
declare eTN
declare eStatus
declare eNBSelected

MACRO SHARED_VARIABLE GET_VALUE("eSharedImages", eList)
MACRO SHARED_VARIABLE GET_VALUE("eSharedImageIndex", eIndex)
TREEVIEW IMAGE GET_NB(eTemp)
TREEVIEW IMAGE GET_NB_SELECTED(eNBSelected)
if $eNBSelected == 1
    while $ei <=$eTemp
        TREEVIEW IMAGE GET_NAME($ei, eList[$ei])
        TREEVIEW IMAGE GET_SELECTION_STATUS($ei, eStatus)
        if $eStatus == "On"
            set eIndex $ei
            set ei $eTemp
        endif
        ++ ei
    endwhile
   
    VIEW VISIBILITY OBJECTS KEEP($eList[$eIndex])
    MACRO SHARED_VARIABLE CREATE("eSharedImages", $eList)
    MACRO SHARED_VARIABLE CREATE("eSharedImageIndex", $eIndex)
   
   
    MACRO SHARED_VARIABLE SET_VALUE("eSharedImages", $eList)
    macro SHARED_VARIABLE SET_VALUE("eSharedImageIndex", $eIndex)
else
    VIEW VISIBILITY OBJECTS KEEP
endif


Hmm, looking at this one again, it seems to suffer from the same issue of relying on the list existing already.  This was sloppy of me, but so long as you use one of the two scrolling macros first these will all work fine. 

On a side note, I added the lines at the bottom so that, should I have multiple images selected, instead of indexing and keeping, it only keeps the selected images.  I use this as a lazy shortcut for ctrl+shift+k - just hit 'k'!

*EDIT* for forgetting that some people might be unaware of assigning hotkeys to macros.  For now, I'll just say that it's in the customize window (where you go to import macros etc), the keyboard tab, set the category drop box to Macro Scripts.  It's pretty straight forward from there.  Just remember not to overwrite any existing shortcuts.
#8
Hmm.  Well, the results provided by this macro could be reproduced in significantly fewer lines.

Here:


version "4.0"
# Macro to remove n layers of the outside of scans

DECLARE nb_layers 1
DECLARE nb_images 0
DECLARE i 1
DECLARE ans 1


TREEVIEW IMAGE GET_NB(nb_images)

INPUT DOUBLE(nb_layers,"Please input the number of layers to remove",\
    "Please input the number of layers to remove",\
    $nb_layers)

INPUT QUESTION(ans, "Do you want to continue?")
SELECT NONE

if $ans == 1
    select all
    config modify NB_LAYERS($nb_layers)
    select shrink_all
    select invert
    edit delete
endif

#what follows is obsolete code


#while $i <=$nb_images
#    window refresh("Off")
#    if $ans == 0
#        break
#    endif
#    TREEVIEW SELECT NONE
#    TREEVIEW IMAGE SELECT ( $i, "On" )
#    EDIT OBJECT USE ()
#    SELECT OBJECT INVERT
#    EDIT OBJECT IGNORE ( )
#    TREEVIEW SELECT NONE
#    TREEVIEW IMAGE SELECT ( $i, "On" )
#    SELECT ALL
#    CONFIG MODIFY NB_LAYERS ( $nb_layers )
#    SELECT SHRINK_ALL
#    SELECT INVERT
#    EDIT DELETE
#    ++ i
#    Window refresh("On")
#endwhile
#
#TREEVIEW SELECT IGNORED
#EDIT OBJECT USE ()
#TREEVIEW SELECT NONE


If you want to expand the macro, you could ignore the images that weren't selected when the macro was pressed and only "shrink" those that were selected - SELECT OBJECT INVERT, EDIT OBJECT IGNORE.  You could, of course, force all selected images into the shrink by adding EDIT OBJECT USE and VIEW VISIBILITY RESTORE to the top, assuming the user wanted to shrink all selected images.

I took my version a few steps further, to the point of being cumbersome, but I find it useful.  The code is fairly old, so it might have a few extra steps in it.  Anyway, here it is:

version "4.0"
declare eSelected 0
declare eIndex 1
declare eI 1
declare eFillList
declare eListSize 1
declare eLayers 0
declare eStatus
declare eTemp 0
declare eName
declare eTotal
declare eGetContinue
declare eGetList
MACRO SHARED_VARIABLE create("eSharedContinue", 0)
MACRO SHARED_VARIABLE create("eSharedList", {0})
MACRO SHARED_VARIABLE GET_VALUE("eSharedContinue", eGetContinue)

if $eGetContinue == 0
    TREEVIEW IMAGE GET_NB(eTotal)
    while $eIndex <= $eTotal
        TREEVIEW IMAGE GET_SELECTION_STATUS($eIndex, eStatus)
        if $eStatus == "On"
            set eFillList[$eListSize] $eIndex
            ++ eListSize
        endif
        ++ eIndex
    ENDWHILE
    MACRO SHARED_VARIABLE SET_VALUE("eSharedList", $eFillList)
    while $eI <= $eTotal
        if $eI == $eFillList[1]
            TREEVIEW IMAGE GET_NAME($eI, eName)
            VIEW VISIBILITY OBJECTS KEEP($eName)
            ##########
            while $eTemp == 0
                INPUT INTEGER(eLayers,"Layer size.", "How many layers to shrink?", 0)
                if $eLayers > 10
                    set eLayers 10
                else
                    if $eLayers < 0
                        set eLayers 0
                    endif
                endif
                if $eLayers > 0
                    SELECT ALL
                    CONFIG MODIFY NB_LAYERS ( $eLayers )
                    SELECT SHRINK_ALL
                    SELECT INVERT
                endif
                #Macro pause ("Pause", "Examine the selected elements.")
                INPUT QUESTION(eTemp, "Keep this shrink?")
               
               
            endwhile
            ########
            ++ eI
            MACRO SHARED_VARIABLE SET_VALUE("eSharedContinue", 2)
            Macro end
        endif
        ++ eI
    endwhile
else
#    edit delete
    EDIT IGNORE_FOR_MERGING
    MACRO SHARED_VARIABLE GET_VALUE("eSharedList", eGetList)
    TREEVIEW IMAGE GET_NB(eTotal)
    while $eI <= $eTotal
        if $eI == $eGetList[$eGetContinue]
            TREEVIEW IMAGE GET_NAME($eI, eName)
            VIEW VISIBILITY OBJECTS KEEP($eName)
            #######
            while $eTemp == 0
            INPUT INTEGER(eLayers,"Layer size.", "How many layers to shrink?", 0)
            if $eLayers > 10
                set eLayers 10
            else
                if $eLayers < 0
                    set eLayers 0
                endif
            endif
           
            if $eLayers > 0
                SELECT ALL
                CONFIG MODIFY NB_LAYERS ( $eLayers )
                SELECT SHRINK_ALL
                SELECT INVERT
            endif
            #Macro Pause("Pause", "Examine the selected elements.")
            INPUT QUESTION(eTemp, "Keep this shrink?")
           
            endwhile
            ########
            ++ eGetContinue
            MACRO SHARED_VARIABLE SET_VALUE("eSharedContinue", $eGetContinue)
            if $eGetContinue > size(eGetList)
                macro pause("WARNING", "Hopefully this is a warning for the second to last time this macro runs.")
            endif
            Macro end
           
           
        endif
        ++ eI
    endwhile
   
    macro SHARED_VARIABLE DELETE("eSharedContinue")
    macro SHARED_VARIABLE DELETE("eSharedList")

    TREEVIEW SELECT NONE
    TREEVIEW select ALL
    VIEW VISIBILITY OBJECTS KEEP
    TREEVIEW SELECT NONE

    SELECT IMAGE_POINTS IGNORED_FOR_MERGING
    EDIT DELETE


    macro pause("SUCCESS", "Muliple image shrink process finished successfully.")
   
endif   


In order for this macro to work, you must have at least 1 scan selected, and must run the macro once for each scan you had selected when you first ran it.  See?  Cumbersome.

Basically, the macro builds a list of any scans you had selected when you ran it.  It then isolates the first scan and asks for a number of layers to shrink that scan.  The user can confirm or deny the number he entered (denial just asks for a new # of layers).  Then the macro ends.

Now the user can select any additional areas of the image or deselect any edges that he might not have wanted reduced.  This step, for me, make the macro most useful, as I can use it cot only to shrink images, but to remove targets and noise.  It is important to remember NOT to delete the selected areas during this step.

The next time you hit the macro button, any selected elements are flagged as "ignored for merging."  This saves time, as deleting the elements outright is somewhat slow.  It then isolates the next scan in the list for you, and the process continues.

There are two progress checks implemented - a second to last run warning, and a final run success message.  The second to last message is on line 95 and may as well be commented out.

This extra macro serves specifically to reset the first:

version "4.0"
MACRO SHARED_VARIABLE DELETE("eSharedContinue")
MACRO SHARED_VARIABLE DELETE("eSharedList")


There are better ways to do the things I did with this macro, I know.  I'm just posting it because it's the kind of extreme that you can take a layer reduction macro.

*EDIT* for forgetting part of the description of my own macro.