Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisj committed Sep 28, 2023
1 parent 4c11f51 commit b1caa8e
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 147 deletions.
3 changes: 0 additions & 3 deletions src/neuroglancer/annotation/frontend_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ export class MultiscaleAnnotationSource extends SharedObject implements
const annotations: Annotation[] = [];
const {segmentFilteredSources, spatiallyIndexedSources, rank, properties, relationships} = this;
const {relationshipStates} = state.displayState;

let hasVisibleSegments = false;
for (let i = 0; i < relationships.length; i++) {
const relationship = relationships[i];
Expand Down Expand Up @@ -478,8 +477,6 @@ export class MultiscaleAnnotationSource extends SharedObject implements
}
}
}

console.log("list length", annotations.length);
return annotations;
}

Expand Down
4 changes: 0 additions & 4 deletions src/neuroglancer/annotation/type_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,22 +231,18 @@ export abstract class AnnotationRenderHelper extends AnnotationRenderHelperBase
this.hashColorShaderManager.defineShader(builder);
for (let i = 0, numProperties = properties.length; i < numProperties; ++i) {
const property = properties[i];

const enumLabels = (property as AnnotationNumericPropertySpec).enumLabels || [];
const enumValues = (property as AnnotationNumericPropertySpec).enumValues || [];

for (let i = 0; i < enumLabels.length && i < enumValues.length; i++) {
builder.addVertexCode(`#define prop_${property.identifier}_${enumLabels[i]} uint(${enumValues[i]})\n`);
}

const functionName = `prop_${property.identifier}`;
if (!controlsReferencedProperties.includes(property.identifier) &&
!processedCode.match(new RegExp(`\\b${functionName}\\b`))) {
continue;
}
referencedProperties.push(i);
}
// here
this.defineProperties(builder, referencedProperties);
builder.addUniform('highp vec3', 'uColor');
builder.addUniform('highp uint', 'uSelectedIndex');
Expand Down
26 changes: 11 additions & 15 deletions src/neuroglancer/datasource/cave/backend.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import {AnnotationGeometryChunk, AnnotationGeometryChunkSourceBackend, AnnotationGeometryData, AnnotationMetadataChunk, AnnotationSource} from "neuroglancer/annotation/backend";
import {AnnotationSubsetGeometryChunk} from "neuroglancer/annotation/backend";
import {WithParameters} from "neuroglancer/chunk_manager/backend";
import {WithSharedCredentialsProviderCounterpart} from "neuroglancer/credentials_provider/shared_counterpart";
import {CancellationToken} from "neuroglancer/util/cancellation";
import {responseJson} from "neuroglancer/util/http_request";
import {SpecialProtocolCredentials, SpecialProtocolCredentialsProvider} from "neuroglancer/util/special_protocol_request";
import {registerSharedObject} from "neuroglancer/worker_rpc";
import {AnnotationSourceParameters, AnnotationSpatialIndexSourceParameters, API_STRING} from "./base";
import {AnnotationGeometryChunk, AnnotationGeometryChunkSourceBackend, AnnotationGeometryData, AnnotationMetadataChunk, AnnotationSource} from 'neuroglancer/annotation/backend';
import {AnnotationSubsetGeometryChunk} from 'neuroglancer/annotation/backend';
import {WithParameters} from 'neuroglancer/chunk_manager/backend';
import {WithSharedCredentialsProviderCounterpart} from 'neuroglancer/credentials_provider/shared_counterpart';
import {CancellationToken} from 'neuroglancer/util/cancellation';
import {responseJson} from 'neuroglancer/util/http_request';
import {SpecialProtocolCredentials, SpecialProtocolCredentialsProvider} from 'neuroglancer/util/special_protocol_request';
import {registerSharedObject} from 'neuroglancer/worker_rpc';
import {AnnotationSourceParameters, AnnotationSpatialIndexSourceParameters, API_STRING} from 'neuroglancer/datasource/cave/base';
import {cancellableFetchSpecialOk} from 'neuroglancer/util/special_protocol_request';
import {vec3} from 'neuroglancer/util/geom';
import {AnnotationBase, AnnotationNumericPropertySpec, AnnotationSerializer, AnnotationType, Line, Point, makeAnnotationPropertySerializers} from "neuroglancer/annotation";
import {tableFromIPC} from "apache-arrow";


import {AnnotationBase, AnnotationNumericPropertySpec, AnnotationSerializer, AnnotationType, Line, Point, makeAnnotationPropertySerializers} from 'neuroglancer/annotation';
import {tableFromIPC} from 'apache-arrow';

function parseCaveAnnototations(annotationsJson: any[], parameters: AnnotationSourceParameters) {
const seenEnums = new Map<String, Set<String>>();
Expand Down Expand Up @@ -117,7 +115,6 @@ export class CaveAnnotationSourceBackend extends (WithParameters(WithSharedCrede
async downloadSegmentFilteredGeometry(
chunk: AnnotationSubsetGeometryChunk, relationshipIndex: number,
cancellationToken: CancellationToken) {
console.log('cave downloadSegmentFilteredGeometry');
const {credentialsProvider, parameters} = this;
const {timestamp, table, relationships, rank, properties} = parameters;
const payload = `{
Expand All @@ -144,7 +141,6 @@ export class CaveAnnotationSourceBackend extends (WithParameters(WithSharedCrede

async downloadMetadata(chunk: AnnotationMetadataChunk, cancellationToken: CancellationToken) {
cancellationToken;
console.log('cave downloadMetadata');
if (!chunk.key) return;

const {credentialsProvider, parameters} = this;
Expand Down
14 changes: 1 addition & 13 deletions src/neuroglancer/datasource/cave/base.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { AnnotationPropertySpec, AnnotationType } from "src/neuroglancer/annotation";
// import { ShardingParameters } from "../precomputed/base";
import {AnnotationPropertySpec} from "neuroglancer/annotation";

export const API_STRING_V2 = 'api/v2';
export const API_STRING = 'api/v3';


// export class AnnotationSpatialIndexSourceParameters {
// url: string;
// // sharding: ShardingParameters|undefined;
// static RPC_ID = 'cave/AnnotationSpatialIndexSource';
// }

AnnotationType; // TODO

export class AnnotationSourceParameters {
url: string;
datastack: string;
Expand All @@ -21,8 +11,6 @@ export class AnnotationSourceParameters {
rank: number;
relationships: string[];
properties: AnnotationPropertySpec[];
// byId: {url: string; sharding: ShardingParameters | undefined;};
// type: AnnotationType;
static RPC_ID = 'cave/AnnotationSource';
}

Expand Down
Loading

0 comments on commit b1caa8e

Please sign in to comment.