This is an old revision of the document!


Sql

This logic can be used to perform database related operations on header keys of one or two stacks of images to filter them for certain criteria.

In order to filter a stack of images SQL syntax can be applied. SQL is a powerful language used to filter large datasets. To learn more about SQL please see https://www.sqlite.org/docs.html for detailed information.

  • reproduce the input (default value)

SELECT *, FROM t0

  • rename

SELECT *,classID as clusterMember FROM t0

  • perfom arithmetic on certain header value

SELECT *, (referenceData -120) as referenceData FROM t0

  • count distinct values, example given by referanceData from alignment. t0 := projections, t1 := ali images

SELECT DISTINCT t0.*, COUNT(t1.referenceData) as counter FROM t0, t1 WHERE t1.referenceData == t0.imageID GROUP BY t1.referenceData

  • select only even images (repleace =0 with =1 for odd images)

SELECT * FROM t0 where img%2=0

  • calculate the average of parameter imageID for a given condition (where clause)

SELECT sum(imageID)/count(imageID) as sum FROM t0 where imageID >10 and imageID < 20

  • count the number of distinct values for the header key croppedFromFile and order the output by that key, output will consist of 1 image per unique value

SELECT *, COUNT(croppedFromFile) FROM t0 GROUP BY croppedFromFile

  • Select all images from t0 input where eulerBeta = 130 and eulerGamma is between 190 and 195

SELECT * FROM t0 WHERE eulerBeta = 130 AND eulerGamma BETWEEN 190 AND 195

  • mirror the euler angles of particles (for angular distribution plot with eulerBeta and eulerGamma in Value Viewer)

SELECT *, (180-eulerBeta) AS eulerBeta, CASE WHEN eulerGamma >= 180 THEN eulerGamma-180 ELSE eulerGamma+180 END AS eulerGamma FROM t0

Here, a short introduction for the given mode should be placed. Again, state WHAT and WHY this mode us useful in not more than 2 sentences.

Parameters Description
Some changeable parameter Description of this parameter
→ and its sub-parameter more description
Next main parameter and more more more
→ and its sub-parameter … descriptions
Input Description
FirstInput Input Description 1
SecondInput Input Description 2
ThirdInput Input Description 3: Optional Input in Italic
Output Description
FirstOutput Output Description
New/Changed Header Values Description
headerValue1 what does it say? how is it changed?
headerValue2 what does it say? how is it changed?
headerValue3 what does it say? how is it changed?
headerValue4 what does it say? how is it changed?

In this paragraph, the “HOW a logic works under the hood” and WHY someone should use it can be elaborated with higher detail. Describes a scenario in an image processing workflow where this logic can be used to solve the resulting problem. Also, wikipages, publications or anything else describing the theory behind an algorithm should be linked here, if applicable.