Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Filter images by plane resolution #15

Open
peristeri opened this issue Mar 19, 2018 · 5 comments
Open

Filter images by plane resolution #15

peristeri opened this issue Mar 19, 2018 · 5 comments

Comments

@peristeri
Copy link
Contributor

peristeri commented Mar 19, 2018

Feature

Be able to filter either through the admin or the REST api images by resolution.

The filter is broken down into 3 parts:

  • Isotropic Resolution
    The filter is set in a range min and max
  • Anisotropic Resolution with Axial Orientation
    In the RPI orientation, the in-plane and slice thickness if the 3rd value is larger of the other 2 values
  • Anisotropic Resolution with Sagittal Orientation
    In the RPI orientation, the in-plane and slice thickness if the 1st value is larger of the other 2 values
@peristeri peristeri changed the title Filter images by resolution Filter images by plane resolution Mar 19, 2018
@peristeri
Copy link
Contributor Author

@jcohenadad to properly populate the resolution field, there must be a standard format. I suggest using the the one proposed by @charleygros:

Take the 4th, 5th and 6th of the image dimension in the `RPI` orientation.  ex: 
x, y, z = img.dim[3:6]
data.orientation = "{}x{}x{}".format(x, y, z)

@peristeri
Copy link
Contributor Author

For the case of image grenoble_ofsep_02065SYST/t2_sag/t2_sag.nii.gz, the resolution is 0.74x0.74x4.40 and the orientation is sag. What would be the isotropic resolution, thickness and in-plane?

@jcohenadad
Copy link
Member

"isotropic" means pX=pY=pZ. E.g. 1x1x1mm.

in sagittal data with 0.74x0.74x4.40mm resolution, the thickness is 4.4mm and the in-plane is 0.74x0.74.

what we call thickness is always the dimension that refers to the slice.

but: do we need that information from your web interface? don't you just report "orientation" and "resolution" in XxYxZ, with X, Y and Z defined by the slice orientation (not the physical coordinates of the scanner). I.e., in this example, the "Z" refers to the R-L direction.

@peristeri
Copy link
Contributor Author

peristeri commented Apr 16, 2018

Filtering by plane resolution using thickness and in-plane has too many edge cases that is starting to complicate the query structure. Therefore, for this iteration, the filter will be the following:

To filter by resolution, the query will be structure: resolution={dx}x{dy}x{dz} where the values dx, dy and dz are the values of image.dim[4,6] when the image is at the RPI position.

To filter by sagittal from 1.0 to 5.0: sag=1.0-5.0
To filter by isotropic images: isotropic=true

The filter will not have any concept of thickness and in-plane

peristeri added a commit that referenced this issue Apr 18, 2018
The image model stores the image resolution and calculates if it is isotropic.
In the REST API, the user can query by which plane (sagittal, corrinal, axial)
and if it is isotropic.

Partial #15
peristeri added a commit that referenced this issue Apr 18, 2018
The image model stores the image resolution and calculates if it is isotropic.
In the REST API, the user can query by which plane (sagittal, corrinal, axial)
and if it is isotropic.

Partial #15
@peristeri
Copy link
Contributor Author

@benjamindeleener :
The filtering by a range is possible. The user need to provide a upper and lower bound in the form of [lower]-[upper]. I use sagittal instead of x because the expected results will differ to one image to the other, since they might be saved in different orientation. Having combinations as you present them can make for a very complicated query to the database and with the limited time, I don't think the time to implement. An alternative is to make multiple queries for each combination and mage the results.

Finding datasets with sagittal and axial resolution less then 1.0mm and not isotropic ex: ?sagittal=0.0-1.0&axial=0.0-1.0&isotropic=False

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants