Hi Alexis,

  You are right "volume onesmask #1 onGrid #2"  where #1 is a surface and #2 is a map, produces a new map with ones inside the surface on a grid that is usually smaller than map #2.  What it is doing is using a subregion of #2 that covers the surface #1.  That may sometimes be desirable to make a smaler map, but seems like the wrong default.  So I've changed it so it now produces a volume that is exactly the same size as #2.  To get the old behavior where it uses a subregion I added the "fullMap" option, "volume onesmask #1 onGrid #2 fullMap false" will give a subregion, but the default is fullMap true.

  If you want to use the full grid with older ChimeraX you can use "volume onesmask #1 onGrid #2 border 1".  Formerly if the "border" option was non-zero then it used the full map.  If you specify the onGrid option the border option is now ignored (logically it would extend the onGrid map, but I don't have time to add capabilities that no one has ever needed, so for now border only is used if you do not specify onGrid).

Tom


On Mar 28, 2020, at 8:19 PM, Alexis Rohou <a.rohou@gmail.com> wrote:

Hi Tom,

Old thread, but I was playing with volume onesmask #n onGrid #m today, and it was not giving an output of the same dimensions as volume #m. Easy enough to then do a volume resample onGrid, but this was not the behavior I expected.

This was with 0.92 (2020-02-20, the palindrome version!) so not the latest, but I wonder whether you can reproduce this and confirm whether that's expected behavior.

Cheers,
Alexis

On Wed, Dec 11, 2019 at 4:22 PM Alexis Rohou <a.rohou@gmail.com> wrote:
Hi Tom,

Excellent! Turning maps into masks is a pretty common task and I think this will be my new favorite way to do it. 

Thanks a lot!

Cheers,
Alexis

On Wed, Dec 11, 2019 at 2:48 PM Tom Goddard <goddard@sonic.net> wrote:
Hi Alexis,

  I added an onGrid option to the volume onesmask command.  So you can create a mask from the volume #1 surface on the grid of volume #1 using

volume onesmask #1 ongrid #1

This will be in tonight's ChimeraX builds.

Tom


On Dec 11, 2019, at 10:20 AM, Alexis Rohou <a.rohou@gmail.com> wrote:

Thanks Elaine,

Thanks for the clarification - I figured I wasn't reading things carefully enough. 

I worked with "volume mask" followed by "volume threshold" exactly as you suggest, and it worked fine. 

The "volume onesmask" as it is now stands out from most other volume operations in that it creates an entirely new grid and doesn't even let us stay on the same grid as the input. This makes it not-very-useful for my regular work, but I'm sure there was a good reason initially.

Just saw Tom's email re. surface v volume distinction. Makes sense of course, though I do think harmonizing the options across volume operations would be nice if easily achievable. 

Cheers,
Alexis

On Wed, Dec 11, 2019 at 10:15 AM Elaine Meng <meng@cgl.ucsf.edu> wrote:
Hi Alexis,
The “remaining options” referred to those which are shown in the usage line for “volume onesmask” but not explained directly in that section:

• volume onesmask  surface-spec  [ border  B ] [ spacing  S | Sx,Sy,Sz ] [ pad  distance ] [ extend  N ] [ slab  width | d1,d2 ] [ invertMask  true | false ] [ axis  vector-spec ] [ sandwich  true | false ] [ fillOverlap  true | false ] [ modelId  M ]

<http://rbvi.ucsf.edu/chimerax/docs/user/commands/volume.html#onesmask>

Options not shown in that usage line are not available, at least as far as I knew when I wrote the documentation.  You can always check with the “usage” command, e.g. “usage volume onesmask”  will show all of its current options in the Log.

The differences are that mask has a fullmap option whereas onesmask has border and spacing options. I don’t know the rationale for the differences, sorry.  I imagine you might be able to get the result you wanted with a combination of operations, maybe using “volume mask” first and then “volume threshold” to reset all nonzero values to 1, but I don’t know how well that would work, and it seems unnecessarily indirect.  If I think of anything better, will let you know. 
Elaine
-----
Elaine C. Meng, Ph.D.
UCSF Chimera(X) team
Department of Pharmaceutical Chemistry
University of California, San Francisco

> On Dec 11, 2019, at 9:58 AM, Alexis Rohou <a.rohou@gmail.com> wrote:
>
> Hi there,
>
> I was trying to use "volume onesmask" to go quickly from a dusted surface of a low-pass-filtered volume to a mask volume with the same dimensions, spacing, etc. as the input map.
>
> I thought "fullmap" might be a way to achieve this (the doc says "The remaining options are the same as described for volume mask"), but I don't think that option actually works with "volume onesmask":
>
> volume onesmask #3 fullmap true
> Expected a keyword
>
> Is there a "onesmask"-like operation or set of options that creates an output volume that's on the same grid as the input volume?
>
> Thanks,
> Alexis

_______________________________________________
ChimeraX-users mailing list
ChimeraX-users@cgl.ucsf.edu
Manage subscription:
http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users