Forums » Software Installation »
K2 Camera Orientation / SERIALEMCCD socket connection not opened with DM 2.30
Added by Long Gui almost 11 years ago
Dear all,
I am trying to install Leginon clients on the Gatan K2 camera and the instruction says the camera configuration in Digital Micrograph will need a rotation and flip (270 degree rotation and a horizontal flip.
I checked the Camera -> Camera configration but I did not find the horizontal flip option. (as the attached figure shows, I could only find rotation angles and vertical axis flip option)
Where should I look for the horizontal flip or did I misunderstand something..?
Cheer,
Long
Attached_Figure.png (28.8 KB) Attached_Figure.png |
Replies (13)
RE: K2 Camera Orientation - Added by Anchi Cheng almost 11 years ago
Umm, maybe wording is different now. Well just make it so that the orientation you see (rotation and mirror) be as close to what you see looking down the main screen of the microscope viewing port. For example, if you put the pointer showing blocking the top right on the microscope screen, the image you get should be blocked also at top right. This helps Appion processing and possibility tilt correction like ones used in tomography and rct data collection algorithm.
RE: K2 Camera Orientation - Added by Anchi Cheng almost 11 years ago
Long,
You are right, though, I just checked. It says flip around the vertical axis on our K2. I will change the documentation
RE: K2 Camera Orientation - Added by Long Gui almost 11 years ago
Hello Anchi,
Thank you very much for your help. I have set 270 degrees rotation and vertical axis flip.
I also set up the SERIALEMCCD_PORT according to the SerialEM website:
http://bio3d.colorado.edu/SerialEM/hlp/html/setting_up_serialem.htm
But when I run the test command:
import pyscope.dmsem
k = pyscope.dmsem.GatanK2Counting()
k.setExposureTime(200)
k.getImage()
The command exit with an error:
[Error 10061] No connection could be mande because the target machine actively refused it. (Also see the attached file)
Have you ever seen this problem before? Could you show me a solution for it?
Thanks again,
-Long
attached.jpg (3.09 MB) attached.jpg |
RE: K2 Camera Orientation - Added by Anchi Cheng almost 11 years ago
First, This will only works is DM is started.
Second, give me the version number of Digital Micrograph. We have a on-going issue with Gatan's newer installation such as 2.30.542.0
RE: K2 Camera Orientation - Added by Long Gui almost 11 years ago
Hello Anchi,
Sorry I forget to mention that I have already run DM before I tested the command.
Our Digital Micrography version is 2.30.542.0 and we have get it installed last November. I think it is the reason.
Thanks a lot,
-Long
RE: K2 Camera Orientation - Added by Anchi Cheng almost 11 years ago
Long,
David Mastronarde created a build based on the new version of DM. You can find it in SerialEM download site under DMplugInBeta/SEMCCD-GMS2.3-64.dll. Please give it a try. The K2 that has this problem at our site is down for moving. Please help us test it. Thank you.
RE: K2 Camera Orientation - Added by Anchi Cheng almost 11 years ago
By the way, when you test it, set environment variable SERIALEMCCD_DEBUG to be 2 on K2 computer so that it can output debug log into DM's Results panel. In particular, we want to know if you get a message saying that it is "Going to start socket", and then if it says that it is listening.
RE: K2 Camera Orientation - Added by Long Gui almost 11 years ago
Hello Anchi,
I have downloaded the new SEMCCD-GM2.3-64.dll and copied it into Gatan\Plugins folder. And I have set the SERIALEMCCD_DEBUG environment variable to 2.
The next step is to restart the Gatan DigitalMicrography software and I have notice the Results in DM software shows:
Microscope Control Initialization Succeeded.
1428.694 DMCamera Debug :
SerialEMCCD: COM was initialized through DllMain
1428.694 DMCamera executing script :number version
GetApplicationInfo(2, version)
Exit(version)1428.694 DMCamera Debug :
Return value = 5.10525e+007
1428.694 DMCamera Debug :
retval = 5.10525e+007, code = 30b0000, version = 31100
1428.694 DMCamera Debug :
Going to start socket
1428.710 DMCamera Debug :
SerialEMCCD: COM was initialized through DllMain
1428.710 DMCamera executing script :number version
GetApplicationInfo(2, version)
Exit(version)1428.710 DMCamera Debug :
Return value = 5.10525e+007
1428.710 DMCamera Debug :
retval = 5.10525e+007, code = 30b0000, version = 31100
1428.710 DMCamera Debug :
Going to start socket
1428.726 DMCamera Debug :
SerialEMCCD: COM was initialized through DllMain
1428.726 DMCamera executing script :number version
GetApplicationInfo(2, version)
Exit(version)1428.726 DMCamera Debug :
Return value = 5.10525e+007
1428.726 DMCamera Debug :
retval = 5.10525e+007, code = 30b0000, version = 31100
1428.726 DMCamera Debug :
Going to start socket
1428.710 DMCamera Debug :
Socket startup OK, going to start select loop
Welcome to DigitalMicrograph. 1/9/2014, 10:28:34 AM
1540.469 DMCamera Debug :
Select returned with Ready channel: listener 1 client 0
1540.469 DMCamera Debug :
SerialEMSocket: Accepted connection
1577.956 DMCamera Debug :
Select returned with Ready channel: listener 0 client 1
1577.972 DMCamera Debug :
SerialEMSocket: got 12 bytes via recv on socket 260
1577.972 DMCamera executing script :Object manager = CM_GetCameraManager()
Object cameraList = CM_GetCameras(manager)
Object camera = ObjectAt(cameraList, 0)
CM_SelectCamera(manager, camera)1577.987 DMCamera Debug :
Return value = 0
1577.987 DMCamera Debug :
In SendBuffer, socket 260, sending 8 bytes
1578.003 DMCamera Debug :
Select returned with Ready channel: listener 0 client 1
1578.019 DMCamera Debug :
SerialEMSocket: got 56 bytes via recv on socket 260
1578.034 DMCamera Debug :
SetK2Parameters called with save 0
1578.050 DMCamera Debug :
In SendBuffer, socket 260, sending 8 bytes
1578.065 DMCamera Debug :
Select returned with Ready channel: listener 0 client 1
1578.065 DMCamera Debug :
SerialEMSocket: got 48 bytes via recv on socket 260
1578.081 DMCamera Debug :
SetupFileSaving error is 13
1578.081 DMCamera Debug :
In SendBuffer, socket 260, sending 12 bytes
1578.097 DMCamera Debug :
Select returned with Ready channel: listener 0 client 1
1578.112 DMCamera Debug :
SerialEMSocket: got 76 bytes via recv on socket 260
1578.112 DMCamera executing script :
(I would assume that they are self-testing when I run the Gatan DigitalMicrograph software.)
Then I tried to run these in the Python:
import pyscope.dmsem
k = pyscope.dmsem.GatanK2Counting()
k.setExposureTime(200)
k.getImage()
This time, the python program did not exit with an error. And the results from the python are attached as the attached images.
Also, the Results in DM software shows:
Object manager = CM_GetCameraManager()
Object cameraList = CM_GetCameras(manager)
Object camera = ObjectAt(cameraList, 0)
CM_SelectCamera(manager, camera)
Object acqParams = CM_CreateAcquisitionParameters_FullCCD(camera, 1, 0.2, 1, 1)
CM_SetBinnedReadArea(camera, acqParams, 0, 0, 3838, 3710)
CM_SetCorrections(acqParams, 49, 0)
CM_SetSettling(acqParams, 0)
CM_SetShutterIndex(acqParams, 0)
CM_SetReadMode(acqParams, 2)
K2_SetHardwareProcessing(camera, 6)
Number wait_time_s
CM_PrepareCameraForAcquire(manager, camera, acqParams, NULL, wait_time_s)
Sleep(wait_time_s)
Image img := CM_AcquireImage(camera, acqParams)
KeepImage(img)
number retval = GetImageID(img)
Exit(retval)1579.844 DMCamera Debug :
Return value = 18
1579.859 DMCamera Debug :
Converting unsigned integers to unsigned shorts
1579.875 DMCamera Debug :
In SendBuffer, socket 260, sending 24 bytes
1579.891 DMCamera Debug :
retval = 0, err sending args 0, sending image 27528200 in 1 chunks
1579.891 DMCamera Debug :
In SendBuffer, socket 260, sending 27528200 bytes
Does that indicates now the pyscope.py could work nicely with the new Gatan DM software 2.30.542.0?
Thanks a lot for your help with this issue!
Cheers,
Long
RE: K2 Camera Orientation - Added by Long Gui almost 11 years ago
Hello Anchi,
I have tested the Leginon with K2 camera on the Application/Calibration and the Leginon works fine on all the CentOS computer, TEM computer and K2 computer.
However, I have 2 questions,
(1) I checked the K2 camera orientation at the beginning and noticed that Gatan DigitalMicrograph software automatically recover the 270 rotation and flip along vertical axis to the default states (no rotation, no flip). I changed it back but every time I restarted DM software, the 270 rotation and flip was substituted by the default settings. Have you seen similar problem like this before? Or maybe I can contact Gatan to ask for their advice.
(2) I am little confused by the dark/gain reference in these following two websites:
http://emg.nysbc.org/projects/leginon/wiki/Using_Gatan_K2_Summit_in_Leginon
http://emg.nysbc.org/projects/leginon/wiki/Bright_and_Dark_reference_images
I basically followed the later website and only applied Dark reference and Bright reference on both channels in Leginon and did not change anything in Gatan DigitalMicrograph. Did I finish this calibration correctly?
I have attached 2 images. One is the raw image and the other is the corrected image. (You may notice there is a dark line in the raw image but it disappears in the corrected image.)
Thanks,
Long
RE: K2 Camera Orientation - Added by Anchi Cheng almost 11 years ago
(1) Yes, you should contact them after you try this: change the configuration and then close DM without using it for other things. It will provide a basic test for them as well.
(2) The procedure in http://emg.nysbc.org/projects/leginon/wiki/Bright_and_Dark_reference_images is basically correct.
However, you need to make modification according to what is said in http://emg.nysbc.org/projects/leginon/wiki/Using_Gatan_K2_Summit_in_Leginon because counting camera need special precaution to give you a usable gain reference.
There are a lot more to this that I can say. Do you mind start a new thread under Leginon? This is more a usage issue. It will help others in searching for the topic.
RE: K2 Camera Orientation - Added by Long Gui almost 11 years ago
Hello Anchi,
Thank you very much. I will start a new session about the K2 camera calibrations...
Just another quick question: I saw a dark line in the raw image. Does the K2 camera in Scripps also contain this strange artifact background?
-Thanks,
Long
RE: K2 Camera Orientation / SERIALEMCCD socket connection not opened with DM 2.30 - Added by Anchi Cheng almost 11 years ago
Hi, Long,
Just noticed that I let you hang there. We also have a dark line on one of the cameras. Just mark it as bad column in Correction Node.
RE: K2 Camera Orientation / SERIALEMCCD socket connection not opened with DM 2.30 - Added by Anchi Cheng almost 10 years ago
Update on the issue of connection actively refused by target host when instance is created for dmsem K2 camera.
We have seen two more cases of this even though DM version is matched with SerialEMCCD.dll. In at least one case multiple trials were made to install. It is possible that the computer was confused with different registered dll. After cleaning up the dll from plugin folder, restarting the computer, and then repeat the installation cleanly, it worked.