Skip to content

Commit 73285c9

Browse files
committed
move from reconstruction to cell morphology
1 parent dd9cf49 commit 73285c9

File tree

56 files changed

+554
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+554
-232
lines changed

src/api/entitycore/guards.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function hasAssets(
2222
export function isReconstructionMorphology(
2323
entity: EntityCoreObjectTypes
2424
): entity is IReconstructionMorphology {
25-
return entity.type === EntityTypeEnum.ReconstructionMorphology;
25+
return entity.type === EntityTypeEnum.CellMorphology;
2626
}
2727

2828
export function isElectricalCellRecording(
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { entityCoreApi, getEntityCoreContext } from '@/api/entitycore/utils';
2+
import type {
3+
ExpandCellMorphologyParm,
4+
CellMorphologyFilter,
5+
ICellMorphology,
6+
ICellMorphologyExpanded,
7+
} from '@/api/entitycore/types/entities/cell-morphology';
8+
import type { EntityCoreResponse } from '@/api/entitycore/types/shared/response';
9+
import type { WorkspaceContext } from '@/types/common';
10+
11+
const baseUri = '/cell-morphology';
12+
/**
13+
* Retrieves a list of cell morphologies from the EntityCoreAPI.
14+
*
15+
* @param {Object} options - The options object
16+
* @param {CellMorphologyFilter} [options.filters] - Optional filters to apply to the query
17+
* @returns {Promise<EntityCoreResponse<ICellMorphology>>} A promise that resolves to the list of cell morphologies
18+
*/
19+
export async function getCellMorphologies({
20+
withFacets,
21+
filters,
22+
context,
23+
}: {
24+
withFacets?: boolean;
25+
filters?: CellMorphologyFilter;
26+
context?: WorkspaceContext | null;
27+
}) {
28+
const api = await entityCoreApi();
29+
return await api.get<EntityCoreResponse<ICellMorphology | ICellMorphologyExpanded>>(baseUri, {
30+
queryParams: {
31+
...filters,
32+
with_facets: withFacets,
33+
},
34+
headers: {
35+
accept: 'application/json',
36+
'content-type': 'application/json',
37+
...getEntityCoreContext(context).headers,
38+
},
39+
});
40+
}
41+
42+
/**
43+
* Retrieves a specific cell morphology by its ID from the EntityCoreAPI.
44+
*
45+
* @param {Object} params - The parameters object
46+
* @param {string} params.id - The unique identifier of the cell morphology to retrieve
47+
* @param {ExpandCellMorphologyParm} params.expand - Parameter to specify if the morphology should be expanded
48+
* @returns {Promise<ICellMorphology | ICellMorphologyExpanded>} A promise that resolves to the requested cell morphology
49+
*/
50+
export async function getCellMorphology({
51+
id,
52+
expand,
53+
context,
54+
}: {
55+
id: string;
56+
expand?: ExpandCellMorphologyParm;
57+
context?: WorkspaceContext | null;
58+
}) {
59+
const api = await entityCoreApi();
60+
return await api.get<ICellMorphology | ICellMorphologyExpanded>(`${baseUri}/${id}`, {
61+
queryParams: {
62+
expand,
63+
},
64+
headers: {
65+
accept: 'application/json',
66+
'content-type': 'application/json',
67+
...getEntityCoreContext(context).headers,
68+
},
69+
});
70+
}

src/api/entitycore/queries/experimental/reconstruction-morphology.ts

Lines changed: 0 additions & 75 deletions
This file was deleted.

src/api/entitycore/queries/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export * from '@/api/entitycore/queries/experimental/reconstruction-morphology';
1+
export * from '@/api/entitycore/queries/experimental/cell-morphology';
22
export * from '@/api/entitycore/queries/experimental/electrical-cell-recording';
33
export * from '@/api/entitycore/queries/experimental/synapses-per-connection';
44
export * from '@/api/entitycore/queries/experimental/neuron-density';

src/api/entitycore/types/entities/bouton-density.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import type {
55
SharedFilter,
66
ContributionFilter,
77
BrainRegionFilter,
8-
SpeciesFilter,
9-
StainFilter,
108
MtypeFilter,
9+
SubjectFilter,
1110
} from '@/api/entitycore/types/shared/request';
1211
import type { IExperimentalDensity } from '@/api/entitycore/types/shared/density';
1312

@@ -21,7 +20,6 @@ export type ExperimentalBoutonDensityFilter = Partial<
2120
PaginationFilter &
2221
ContributionFilter &
2322
BrainRegionFilter &
24-
SpeciesFilter &
25-
StainFilter &
26-
MtypeFilter
23+
MtypeFilter &
24+
SubjectFilter
2725
>;

0 commit comments

Comments
 (0)