Comments (12)
@gowrimanoharir Sounds like a good approach.
from mri-volume-slice.
@Irev-Dev thanks i will work on it
from mri-volume-slice.
@Irev-Dev I would like to give this a try, please let me know.
from mri-volume-slice.
Looks like their graphql does not provide filters.
The only filter they have is on dataset id. May be we can query by randomly generating ids.
dataset(id: "ds000001") {
id
draft {
id
partial
files {
urls
filename
}
summary {
totalFiles
__typename
}
__typename
}
}
}
from mri-volume-slice.
@Irev-Dev Actually if we are worried about only the urls then the query you added can be reduced to below that way we are only getting the required data and so it would be little faster.
{
datasets {
id
draft {
files {
urls
}
}
}
}
With respect to limiting results i could not find a query param in their schema to mention number of records. But another way, would be to first send the query only to get the ids as below.
Get all Ids:
{
datasets {
id
public
}
Then from that set randomize to pick one id and send a query by passing that id to get the file urls which we can then be filtered for required file type.
{dataset(id: "ds000117") {
id
draft {
id
partial
files {
urls
filename
}
}
}
}
from mri-volume-slice.
@Irev-Dev I implemented the randomize functionality, got below questions while testing those:
-
There is caching functionality which means the randomize will work only for first time users or when user cleared the cache, assume that what is needed?
-
some of the files seems to come with different sizes for example below is a smaller one:
from mri-volume-slice.
one more example: direct url for this https://openneuro.org/crn/datasets/ds001529/files/sub-iso2239:ses-1:func:sub-iso2239_ses-1_task-rest_acq-EPI_bold.nii.gz
from mri-volume-slice.
Awesome @gowrimanoharir 👑
Really good points you're bringing up here.
Question 1)
Correct, I think it makes sense to give a random dataset, but because it takes a while to fetch a data set from open neuro I wanted the caching, so you get the last data set you were looking at.
The way I see this working is
- Like you said, random for the first time (or when cache is cleared)
- have a button on the UI "load new random MRI" which would then run your query and fetch a new random dataset.
If you want I can get a button ready in the HTML/CSS❓
Question 2)
TL:DR version
We want datasets with files names that end in .nii.gz
(as previously mentioned) AND have T1w
in the name. The second image you posted looks like it definitely 'functional data' I can tell by looking at it and the file name with EPI_bold
gives it away, we should avoid this type of data by looking for T1w
. But besides that the data will tend to come in different dimensions
Verbose version
Something I forgot about, in neuro science there are typically two types of data loosely referred to as functional and anatomical data, anatomical data is what we want, these are higher resolution, normally of the entire brain and better contrast i.e. they will look better in the viewer. If you are interested functional MRI or fMRI is what is used to scan the brain multiple times to learn something from the brain activity (a scan every two seconds is typical), but normally only the part of the brain that is of interest to the researchers is scanned (to make the scan times faster) and hence they won't look very good on the our viewer 😔 . Both types of data still come in the nifti format .nii
but fortunately the datasets on open neuro use the BIDS structure (brain imaging data structure) which means the data sets that we want will have T1w
in the name 🎉 , link if interested.
I did my honours thesis on fMRI, and it's all coming back to me now haha, I forgot about the two different types of data.
Thanks for battling through all this @gowrimanoharir. 🏋️♀️
from mri-volume-slice.
I'm not the best with regular expressions, so this could probably do done in a more concise way, but you could use T1w.+\.?nii\.gz$
to match against the file name.
from mri-volume-slice.
@Irev-Dev Thanks for the detailed explanation, that helps. Though not an expert, i have worked with regex that is a good idea to filter the required file. I will start with what you have suggested and if can be improved will do so.
Also with respect to the Load new MRI button I can add it, please let me know where in the UI it needs to be added and specific styling if any you want?
from mri-volume-slice.
Yup sounds good 🙇♂️
Not too fussed about the button, I guess put it to the right of the cross hair toggle switch and use the same styling as the file browse button i.e. same corner radius and same green.
from mri-volume-slice.
@Irev-Dev Opened a pull request with required changes, please review and let me know for any questions or any fixes/changes
PS: sorry couldnt get to this during the week days.
from mri-volume-slice.
Related Issues (16)
- Update slice with mouse scroll HOT 4
- Add linter HOT 1
- Layout breaks when loading in new data HOT 2
- Disable page scroll when scroll is being used on the UI HOT 1
- Loading state while data is being fetched. HOT 2
- Store MRI data in local storage HOT 2
- Delete old data - Easy first time commit HOT 2
- Thoughts on moving to react? HOT 3
- fetch data from search param in URL HOT 1
- enable toggleable crosshairs HOT 2
- test
- test 2
- test3
- fetch default data from openneuro.org (or else where) HOT 3
- Make cross-hairs update correctly on page load HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mri-volume-slice.