Git Product home page Git Product logo

Comments (12)

Irev-Dev avatar Irev-Dev commented on August 22, 2024 1

@gowrimanoharir Sounds like a good approach.

from mri-volume-slice.

gowrimanoharir avatar gowrimanoharir commented on August 22, 2024 1

@Irev-Dev thanks i will work on it

from mri-volume-slice.

gowrimanoharir avatar gowrimanoharir commented on August 22, 2024

@Irev-Dev I would like to give this a try, please let me know.

from mri-volume-slice.

codegagan avatar codegagan commented on August 22, 2024

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.

gowrimanoharir avatar gowrimanoharir commented on August 22, 2024

@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.

gowrimanoharir avatar gowrimanoharir commented on August 22, 2024

@Irev-Dev I implemented the randomize functionality, got below questions while testing those:

  1. 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?

  2. some of the files seems to come with different sizes for example below is a smaller one:

image

from mri-volume-slice.

gowrimanoharir avatar gowrimanoharir commented on August 22, 2024

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

image

from mri-volume-slice.

Irev-Dev avatar Irev-Dev commented on August 22, 2024

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

  1. Like you said, random for the first time (or when cache is cleared)
  2. 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.

Irev-Dev avatar Irev-Dev commented on August 22, 2024

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.

image

from mri-volume-slice.

gowrimanoharir avatar gowrimanoharir commented on August 22, 2024

@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.

Irev-Dev avatar Irev-Dev commented on August 22, 2024

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.

gowrimanoharir avatar gowrimanoharir commented on August 22, 2024

@Irev-Dev Opened a pull request with required changes, please review and let me know for any questions or any fixes/changes

#39

PS: sorry couldnt get to this during the week days.

from mri-volume-slice.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.