Skip to content
Snippets Groups Projects
Commit 7ee2046c authored by Xiao Gui's avatar Xiao Gui
Browse files

chore: filter dataset filtering first words

chore: reenable ibc datasets
parent 3bbc65ce
No related branches found
No related tags found
No related merge requests found
......@@ -6,18 +6,6 @@ const julichBrainNameToNexusId = require('./supplements/data/julich_brain_name_t
const IBC_DATA_DIR = path.join(__dirname, './supplements/data/ibc/')
const IBC_SCHEMA = '//ibc/ibc_schema'
const getIBCData = () => {
const ibcData = []
const files = fs.readdirSync(IBC_DATA_DIR)
files.forEach((file) => {
ibcData.push(getIbcDatasetByFileName(file))
})
return ibcData
}
const getIbcDatasetByFileName = (file) => {
const str = fs.readFileSync(path.join(IBC_DATA_DIR, file), "utf8");
......@@ -65,6 +53,18 @@ const getIbcDatasetByFileName = (file) => {
}
}
const ibcData = []
const ibcDataFiles = fs.readdirSync(IBC_DATA_DIR)
ibcDataFiles.forEach((file) => {
ibcData.push(getIbcDatasetByFileName(file))
})
const getIBCData = () => {
return ibcData
}
module.exports = {
getIBCData,
getIbcDatasetByFileName,
......
......@@ -146,12 +146,42 @@ const init = async () => {
return await getPublicDs()
}
const dsNamesToExclude = [
'DiFuMo atlas',
'Whole-brain parcellation',
'Probabilistic cytoarchitectonic map',
'Automated Anatomical Labeling (AAL1) atlas',
'Maximum probability map',
'Interpolated 3D map',
'Corrected 3-D reconstruction and surface parcellation',
'Probability map',
'Probabilistic map',
'Reference delineations',
'Atlas of the short fiber bundles ',
'Desikan-Killiany Atlas',
'GapMap',
'Cytoarchitectonic areas',
'Co-activation based parcellation',
'CEREBRUM-7T',
'Filter Activations of Convolutional Neuronal Networks'
]
const getDatasetsByRegion = async ({ regionId, user }) => {
/**
* potentially add other sources of datasets
*/
const kgDatasets = await getDs({ user })
return filterDatasetsByRegion(kgDatasets, regionId)
const excludedDatasets = kgDatasets.filter(({ name }) => {
if (!name) return true
return !dsNamesToExclude.some(n => name.indexOf(n) === 0)
})
return filterDatasetsByRegion([
...excludedDatasets,
/**
* other datasets, such ibc
*/
...ibc.getIBCData(),
], regionId)
}
const getDatasets = ({ templateName, parcellationName, user }) => {
......
......@@ -155,7 +155,7 @@ export class SingleDatasetBase implements OnChanges, OnDestroy {
this.files = files
this.fullId = fullId
this.isGdprProtected = embargoStatus.some(s => s['@id'] === UNDER_REVIEW['@id'])
this.isGdprProtected = embargoStatus && embargoStatus.some(s => s['@id'] === UNDER_REVIEW['@id'])
this.kgReference = kgReference
this.directLinkToKg = getDirectLinkToKg(dataset)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment