Resize volume - AssertionError: Even resample size only

Dear colleagues,

I have imported the volume from EMDB (pixel size 1.065X/pix)
Than I tried to resize it using Volume tools to 0.93 A/pix but got an error.

Traceback (most recent call last):

  • File “cryosparc_master/cryosparc_compute/run.py”, line 96, in cryosparc_master.cryosparc_compute.run.main*
  • File “/data2/cmromao/cryoSPARC/cryosparc_worker/cryosparc_compute/jobs/utilities/run_volume_tools.py”, line 83, in run*
  • assert vol_resample_N % 2 == 0, “Even resample size only”*
    AssertionError: Even resample size only

How can I fix that?
(When using the other software, I don’t have this error.)

Thank you.

Sincerely,
Dmitry

Hi Dmitry,

The output box size has to have dimensions measuring an even number of pixels. Is this maybe where your job is falling down?

Cheers,
Yang

1 Like

hello @leetleyang , perhaps you right. I tried different pixel sizes for the output map but with the same results (in my case). What may also be important is the decimal number after 0 to be even…not sure

@Dmitry Please provide additional details:

  1. The box size (number of pixels along the edge) of the input volume
  2. Parameters specified for the Volume Tools job

The job is expected to fail if

  • the number entered for Resample to box size (pix) is not an even integer

or

  • Resample to box size (pix) is not specified and the input volume’s box size is not even
1 Like

@wtempel,

I am trying to resmaple the follwing volume EMD-12883 to
Resample to box size (pix): 360
Crop to box size (pix): 0.729480712

It is still not working for me in CS.

Could you please prompt how to do that?

thank you.

Sincerely,
Dmitry

Hi @Dmitry,

It looks here like you have entered the pixel size (0.73 Å), rather than the box size you wish to crop to. Could that be the issue?

1 Like

Hi Oli, @olibclarke

Thanks for your prompt response.

I’m a bit unclear on how the Resample to box size feature works.

Crop to box size is straightforward – it involves specifying a desired box size without affecting the pixel size, operating in real space.

However, Resample to box size is causing some confusion. My understanding is that changing the pixel size involves adjusting parameters in Fourier space.

Through some experimentation, I’ve identified the following values:

240px results in 1.065 A/pix
360px results in 0.71 A/pix
384px results in 0.66563 A/pix

I’ve found that 350px at 0.73029 A/pix is what I’m aiming for.

However, I suspect there might be a more elegant way to determine these parameters.

In some software, there’s a window where you can specify the final pixel size, which might be what led to my confusion. :slight_smile:

Any insights or guidance would be much appreciated.

Best, Dmitry

P.s. Happy New Year!

I think of it as:

box_size[input] * voxel_size[input] = box_size[output] * voxel_size[output]

Resample to box size expects box_size[output] in units of pixels as its input parameter. If performing resampling and cropping in the same job, cropping occurs after the resampling operation, so you’ll have to think about this in terms of the resultant resampled box/voxel size.

Generating the desired box/voxel size may require some degree of padding or cropping of the input map, prior to resampling. However, often you can’t get them close enough for cryoSPARC to not complain. In which case once you’ve gotten it as close as you can, you can then fudge it by reimporting the volume and overriding the voxel size to match.

Whether this is appropriate or not depends on what you intend to do with the volume and whether it requires that additional degree of precision.

Cheers,
Yang

2 Likes

Hello Yang, @leetleyang

Many thanks for your clarification.
I was suspecting the proportion, but a clear explanation is much appreciated.

Kind regards,
Dmitry

P.S. Happy New Year.