biocatiit / musclex

Muscle X program suite is a collection of programs intended to assist with analyzing diffraction X-ray images.
Other
5 stars 6 forks source link

musclex cannot read special MarCCD image #22

Closed WeikangMa closed 6 years ago

WeikangMa commented 6 years ago

musclex can read regular 22 binned mar image, but it could not read 11 image after I update it. I was working before. Tom said it might because the 1*1 format was special designed, and wasn't the routine format for PyFAI library. I send you an email with the errors, and shared a test image via dropbox. Please fix it at your earliest convenience.

XintianLee commented 6 years ago

I opened the test image P3_1_1_0002.tif with Quadrant Folding, and it worked fine. image I checked the error traceback you sent me before. There are two failures: the first one occurred when calculating the rotation angle, and the other one occurred when no rotation angle was found because of the first failure. The first failure is caused by pyopencl.MemoryError: clEnqueueNDRangeKernel failed: mem object allocation failure as shown in the traceback, which probably means there was not enough space in the memory to allocate at the time you were working.

weikang@bearshark:~$ musclex qf
P51_1_1_0001.tif is being processed...
Center is being calculated ...
Done. Center = (2072, 2059)
Rotation Angle is being calculated ...
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/musclex/ui/QuadrantFoldingGUI.py", line 1991, in browseFile
    self.onNewFileSelected(str(file_name))
  File "/usr/local/lib/python2.7/dist-packages/musclex/ui/QuadrantFoldingGUI.py", line 1898, in onNewFileSelected
    self.onImageChanged()
  File "/usr/local/lib/python2.7/dist-packages/musclex/ui/QuadrantFoldingGUI.py", line 1616, in onImageChanged
    self.processImage()
  File "/usr/local/lib/python2.7/dist-packages/musclex/ui/QuadrantFoldingGUI.py", line 1764, in processImage
    self.quadFold.process(flags)
  File "/usr/local/lib/python2.7/dist-packages/musclex/modules/QuadrantFolder.py", line 125, in process
    self.rotateImg()
  File "/usr/local/lib/python2.7/dist-packages/musclex/modules/QuadrantFolder.py", line 171, in rotateImg
    self.info['rotationAngle'] = getRotationAngle(img, center)
  File "/usr/local/lib/python2.7/dist-packages/musclex/utils/image_processor.py", line 293, in getRotationAngle
    I2D, tth, chi = ai.integrate2d(img, npt_rad, 360, unit="r_mm", method="csr_ocl")
  File "/usr/lib/python2.7/dist-packages/pyFAI/azimuthalIntegrator.py", line 3006, in integrate2d
    safe=safe)
  File "/usr/lib/python2.7/dist-packages/pyFAI/ocl_azim_csr.py", line 341, in integrate
    ev = self._program.corrections(self._queue, self.wdim_data, self.workgroup_size, *self._cl_kernel_args["corrections"])
  File "/usr/lib/python2.7/dist-packages/pyopencl/__init__.py", line 512, in kernel_call
    global_offset, wait_for, g_times_l=g_times_l)
pyopencl.MemoryError: clEnqueueNDRangeKernel failed: mem object allocation failure

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook/__init__.py", line 388, in process
    proxy(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/cbook/__init__.py", line 228, in __call__
    return mtd(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/musclex/ui/QuadrantFoldingGUI.py", line 909, in imageOnMotion
    img = self.quadFold.getRotatedImage()
  File "/usr/local/lib/python2.7/dist-packages/musclex/modules/QuadrantFolder.py", line 180, in getRotatedImage
    rotate_img = rotateImage(img,self.info["center"], self.info["rotationAngle"], self.info['mask_thres'])
KeyError: 'rotationAngle'
^C
WeikangMa commented 6 years ago

What should I do to fix it? Install more memory card?

XintianLee commented 6 years ago

I don't think it needs a lot of memory. I'm wondering if you always get the same error when you open such images. My suggestion is that first delete the cache of images which fail to be opened and then try reopening them to see what you'll get.

For deleting the cache, there is a folder named qf_cache located in the same directory as the images are. For example, if the image file is P3_1_1_0002.tif, then just delete the file P3_1_1_0002.tif.info in that folder.

Also, I found this link clEnqueueNDRangeKernel failed: mem object allocation failure. Not sure if it can help.