scipion-em / scipion-em-relion

Plugin to use Relion SPA programs within the Scipion framework
GNU General Public License v3.0
3 stars 0 forks source link

invert the mask if required for subtraction #290

Closed azazellochg closed 3 years ago

rmarabini commented 3 years ago

I am checking this

rmarabini commented 3 years ago

Hi @azazellochg,

Sorry for the delay checking this. I have introduced a few modifications in you code.

1) relion_image_handler will either add or multiply by a constant but It will not do both things with a single call. Therefore, two calls are needed to this program

2) I have modified the line

    maskFn = convert.convertMask(self.refMask.get(),
                                 tmp, newPix, newDim, invert)

to

    maskFn = convert.convertMask(self.refMask.get(),
                                 tmp, newPix, newDim, invert=invert)

otherwise the variable invert is assigned to threshold

3) projection_subtraction cannot use more than 1 CPU, I have added a check in validate

4) rescale_angpix param introducess artifacts in the mask if the output sampling is the same than the input 3D mask therefore I skip it for the noRelionInput case.

I think this is all

Thanks for the checking.

Roberto
azazellochg commented 3 years ago

Hi @rmarabini thank you, I'll doouble check and merge this