uhlmanngroup / Cestimii

Curvature Estimation using Integral Invariants
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Working with CCP4 Data within Cestimii #3

Open biberger opened 2 years ago

biberger commented 2 years ago

You can use the Python library Gemmi to handle CCP4 data (example).

To get the data into Python, execute the following code found originally on StackExchange:

import gemmi
ccp4_map = gemmi.read_ccp4_map('my.map')
ccp4_map.setup()  # optional
vol = numpy.array(ccp4_map.grid, copy=False)

Generally, you can leave out the .setup() step.

Depending on the data, you can either work directly on 'vol' or segment it and then work on it with Cestimii. Depending on the segmentation, data or mask, choose whether you want to represent the data as a relaxed or strict occupancy grid (allow values between 0 and 1 or strictly restrict the allowed values to 0,1).

biberger commented 2 years ago

Maybe I'll add this as a feature to Cestimii at one point. But this won't happen in the near future and only if there's interest. In the meantime, just follow the steps above and use the occupancy grid methods in cestimii.