From 838c330900225147760bf877cb66387a217382f6 Mon Sep 17 00:00:00 2001 From: Casey Schneider-Mizell Date: Fri, 14 Apr 2023 22:29:13 -0700 Subject: [PATCH] Adding Minnie streamline --- README.md | 3 - .../data/minnie_um_streamline.json | 1 + standard_transform/datasets.py | 15 +- streamline_generation.ipynb | 271 ++++++++++++++++++ 4 files changed, 280 insertions(+), 10 deletions(-) create mode 100644 standard_transform/data/minnie_um_streamline.json create mode 100644 streamline_generation.ipynb diff --git a/README.md b/README.md index fbc9c67..33f8cc7 100644 --- a/README.md +++ b/README.md @@ -116,9 +116,6 @@ v1dd_ds.streamline_nm.radial_distance(xyz0, xyz1) A particular resolution can be used by passing it as an argument to `dataset.transform_res(voxel_resolution)` or `dataset.streamline_res(voxel_resolution)`. -Note: Currently a data-driven streamline is only available for v1dd. -Minnie65 is using a placeholder "identity streamline" that is just a straight line in the y direction. - ### Minnie65 * `minnie_transform_nm` : Transform from nanometer units in the original Minnie65 space to microns in a space where the pial surface is flat in x and z along y=0. diff --git a/standard_transform/data/minnie_um_streamline.json b/standard_transform/data/minnie_um_streamline.json new file mode 100644 index 0000000..4a0a5ff --- /dev/null +++ b/standard_transform/data/minnie_um_streamline.json @@ -0,0 +1 @@ +[[692.3808957075431, 5.20319177078869, 869.0909776849878], [692.0015172636196, 9.185279807932675, 868.8873385775884], [691.6221388196959, 13.16736784507666, 868.6836994701888], [691.2427603757724, 17.149455882220646, 868.4800603627893], [690.8633819318488, 21.13154391936463, 868.2764212553898], [690.4840034879254, 25.11363195650856, 868.0727821479903], [690.1046250440018, 29.095719993652544, 867.8691430405909], [689.7252466000782, 33.07780803079653, 867.6655039331913], [689.3458681561547, 37.059896067940514, 867.4618648257918], [688.9664897122311, 41.0419841050845, 867.2582257183923], [688.5871112683076, 45.02407214222848, 867.0545866109928], [688.207732824384, 49.006160179372415, 866.8509475035933], [687.8283543804605, 52.988248216516396, 866.6473083961938], [687.448975936537, 56.970336253660385, 866.4436692887942], [687.0695974926133, 60.952424290804366, 866.2400301813948], [686.6902190486899, 64.9345123279483, 866.0363910739953], [686.3108406047663, 68.91660036509228, 865.8327519665958], [685.9314621608428, 72.89868840223626, 865.6291128591963], [685.5520837169191, 76.88077643938026, 865.4254737517967], [685.1727052729956, 80.86286447652424, 865.2218346443973], [684.7933268290722, 84.84495251366816, 865.0181955369977], [684.4139483851485, 88.82704055081214, 864.8145564295983], [684.0345699412248, 92.80912858795614, 864.6109173221988], [683.6551914973013, 96.79121662510012, 864.4072782147992], [683.2758130533778, 100.7733046622441, 864.2036391073998], [682.8964346094542, 104.7553926993881, 864.0000000000002], [682.5170561655307, 108.73748073653202, 863.7963608926008], [682.1376777216071, 112.719568773676, 863.5927217852012], [681.8779517155671, 116.712125042698, 863.3752322316221], [681.6182257095269, 120.70468131172005, 863.1577426780434], [681.4031888375687, 124.70114737335697, 863.1218265826456], [681.1692579046068, 128.69596041884816, 863.1500710315493], [680.9353269716449, 132.69077346433937, 863.1783154804529], [680.701396038683, 136.6855865098305, 863.2065599293566], [680.4674651057211, 140.6803995553217, 863.2348043782602], [680.233534172759, 144.67521260081296, 863.2630488271639], [679.9808645329313, 148.66838622188422, 863.4888215181951], [679.6558859676431, 152.65523363170593, 863.8481050280443], [679.3500103615883, 156.64375233390038, 864.1581323889808], [679.0645487773982, 160.63405703158497, 864.4386664310931], [678.80918150849, 164.62699464069337, 864.6820568266758], [678.555542852894, 168.62008348387008, 864.7805680088668], [678.297378088079, 172.61277634380042, 864.8322946155515], [678.0627566526641, 176.60752897815482, 864.8893129448818], [677.8433764757885, 180.6036150498492, 864.9988737210999], [677.6219203557822, 184.59951950005367, 865.087741730854], [677.4004642357758, 188.595423950258, 865.176609740608], [677.1790081157695, 192.59132840046246, 865.2654777503622], [676.9575519957632, 196.5872328506668, 865.3543457601163], [676.7844786445586, 200.5873702446514, 865.4066863119564], [676.6089739653207, 204.5872949249957, 865.4305760112999], [676.4383399569996, 208.58764573382908, 865.4599462944522], [676.2677059486782, 212.58799654266232, 865.4893165776045], [676.097071940357, 216.5883473514956, 865.5186868607569], [675.9662638194997, 220.59218247399684, 865.5595291429469], [675.9087144698632, 224.60242690848378, 865.6058459220347], [675.9010470034447, 228.61703544226762, 865.6623315472892], [675.8987467159999, 232.63211354336673, 865.7193870245867], [675.8754679400467, 236.64535626454344, 865.7498395801712], [675.8552757647018, 240.65886902828217, 865.779795851298], [675.8695002208276, 244.67539285711146, 865.7899566987196], [675.908119744574, 248.69405097780336, 865.7501934243311], [675.9452385494354, 252.71257780260575, 865.6925833310188], [675.9729683532033, 256.73028319625064, 865.6421292964765], [676.0148719520985, 260.74922863628825, 865.5985827958486], [676.0925083476075, 264.77130029094576, 865.5680508265675], [676.1916217917075, 268.79525094388094, 865.5460131636935], [676.2327596088113, 272.8141293866931, 865.5522802843807], [676.2645341638213, 276.8321886502185, 865.5631187244431], [676.3341801500968, 280.85356123465095, 865.5864918735547], [676.4453198622189, 284.8785640497027, 865.668303776707], [676.5407829341922, 288.90219533645904, 865.7612964672761], [676.6224967189751, 292.9246237164547, 865.8526139648361], [676.7114731786852, 296.94768749817337, 865.9552851060406], [676.8353455259388, 300.9738042744558, 866.1120245145672], [676.9644416273725, 305.0003780700101, 866.304538059511], [677.0905428084553, 309.0266898439854, 866.4956762649318], [677.2213219147924, 313.05341088338935, 866.6770094794113], [677.3472387315517, 317.0797065275765, 866.8548815507509], [677.4012105246846, 321.0997077977992, 867.0092972805003], [677.4465970318424, 325.1189579528259, 867.1609139368693], [677.485521969538, 329.1376427937761, 867.3393309375797], [677.5225927629299, 333.15616541811926, 867.5254382844341], [677.5537572578023, 337.1741713082984, 867.7494940902917], [677.582921359736, 341.1920021867729, 867.986402587083], [677.6120854616697, 345.20983306524744, 868.2233110838746], [677.6412495636034, 349.22766394372195, 868.4602195806659], [677.6704136655369, 353.2454948221964, 868.6971280774576], [677.7409201132402, 357.26694268724935, 868.9686339794706], [677.8729759939912, 361.2937754299404, 869.2567144460169], [677.9927416876022, 365.31953292058404, 869.5417873968024], [678.0598152122191, 369.34068044378415, 869.851366660368], [678.1620366647837, 373.3649030122261, 870.1531025533391], [678.3524892080861, 377.39684480087817, 870.4714940694673], [678.5477416448605, 381.4292065257951, 870.8187051368351], [678.75015560792, 385.4621948030756, 871.2089154863623], [678.9684677255084, 389.4965739886482, 871.6214526591191], [679.2057186074524, 393.5326101014033, 872.0605867833129], [679.385882009346, 397.5636517068246, 872.4845859987654], [679.5388095159659, 401.5923104801685, 872.8993474213833], [679.68988491048, 405.62080721469965, 873.2851115444661], [679.8145743099342, 409.6469954737871, 873.6843132079325], [679.8112836153481, 413.6619869254891, 874.101945760963], [679.7432022474983, 417.6713099277783, 874.5782259486809], [679.6912602977844, 421.6820449461903, 875.0601389201912], [679.6529552373902, 425.6939730378235, 875.541422357562], [679.6820658334993, 429.71179923514495, 875.890717881199], [679.7425757954342, 433.73237252101796, 876.2319093157965], [679.8030857573692, 437.75294580689103, 876.5731007503941], [679.8635957193042, 441.7735190927642, 876.9142921849918], [679.9241056812392, 445.79409237863723, 877.2554836195894], [679.984615643174, 449.8146656645103, 877.5966750541869], [680.0505212458964, 453.83571100778477, 877.9480318258844], [680.1165488375586, 457.8567670237085, 878.5100690826445], [680.316789178699, 461.8895651337122, 879.2459123089992], [680.4908107397198, 465.920069397684, 880.0160076838937], [680.6648323007406, 469.9505736616558, 880.7861030587883], [680.8527623344025, 473.9822947593107, 881.5884593896332], [681.0477131528831, 478.01463009604623, 882.407100558909], [681.2382568466772, 482.04657985933295, 883.3445675915319], [681.4491682453274, 486.0803115658967, 884.4028546538922], [681.6191298105865, 490.1104606262653, 885.3946645179738], [681.7890913758455, 494.140609686634, 886.3864743820554], [681.9637603018782, 498.1711705877055, 887.4321879554317], [682.1518471200704, 502.20290540222936, 888.7361214336826], [682.3600258970625, 506.2363980353763, 890.1026765692218], [682.5682046740546, 510.2698906685231, 891.4692317047611], [682.7618098296533, 514.3021082750116, 892.8527898022714], [682.9757657967056, 518.3361063467958, 894.3067334193466], [683.188613562854, 522.370007463564, 895.8422050412028], [683.4058664540636, 526.4042939788364, 897.3614222645001], [683.6096689803354, 530.4374037396566, 898.8811466715446], [683.8252962368668, 534.4715480303236, 900.3814370896556], [684.0681472083443, 538.5080740874275, 901.8986101884373], [684.2748658136492, 542.5414389721051, 903.2728984626704], [684.4797906224547, 546.5746469199241, 904.6387534441168], [684.7290898372023, 550.6117371252137, 906.1825078304869], [684.7682589364512, 554.6304433275319, 907.9823609580903], [684.6921631916207, 558.6390651626901, 909.8613553030833], [684.6160674467902, 562.6476869978484, 911.7403496480766], [684.6582532571118, 566.6666571281864, 913.3948485444639], [684.715371075284, 570.6869336399352, 915.0821285857409], [684.8117165729689, 574.7106421289379, 916.9737019611911], [684.9080620706535, 578.7343506179405, 918.8652753366414], [685.0044075683385, 582.7580591069429, 920.7568487120916], [685.0394311590038, 586.7764026242555, 922.548704758811], [685.0697878259377, 590.7943378386482, 924.4495594176957], [685.0340391844552, 594.8064895879554, 926.0546941444395], [685.007083745942, 598.8194106428385, 927.624393261271], [685.0427912171215, 602.8378139919431, 929.1659306556169], [685.1310369135654, 606.8608138401604, 930.707473848107], [685.365906051329, 610.8966415773002, 932.2490332220328], [685.6007751890928, 614.9324693144401, 933.7905925959585], [685.8623407093114, 618.970632682402, 935.3263572579677], [686.2553202269044, 623.0202932853624, 937.0395176163742], [686.7516094687023, 627.0789923180232, 938.7096303301789], [687.2478987105004, 631.1376913506838, 940.3797430439834], [687.8866794862432, 635.2088567772129, 942.0286900904188], [688.5226719027181, 639.2797782539162, 943.5841067141077], [689.2867143714034, 643.3619026585519, 945.2660392482238], [690.0917375182411, 647.4476124079498, 946.9836941808995], [690.9058652004994, 651.5341187009833, 948.7104479436155], [691.826432719125, 655.6299372730465, 950.5435748419015], [692.7470002377505, 659.7257558451099, 952.3767017401875], [693.667567756376, 663.8215744171732, 954.2098286384736], [694.6647710200235, 667.9240977481469, 956.2620613182107], [695.7887597024915, 672.0377133659676, 958.6767804363499], [696.9127483849592, 676.1513289837884, 961.091499554489], [698.0984663420384, 680.2703452133453, 963.7196448382219], [700.2454025714662, 684.4734571449068, 967.1493352095146], [702.392338800894, 688.676569076468, 970.5790255808074], [704.539275030322, 692.8796810080295, 974.0087159521001], [707.0282276275934, 697.1127154945175, 977.7867155609563], [709.0692889440858, 701.3065645714454, 982.7401694125042], [711.110350260578, 705.500413648373, 987.693623264052], [713.1514115770701, 709.6942627253009, 992.6470771155998], [715.1924728935625, 713.8881118022285, 997.6005309671476], [717.2335342100546, 718.0819608791563, 1002.5539848186953], [719.2745955265468, 722.275809956084, 1007.5074386702432], [721.3156568430389, 726.4696590330119, 1012.460892521791], [723.3567181595313, 730.6635081099396, 1017.4143463733388], [725.3977794760235, 734.8573571868674, 1022.3678002248868], [727.4388407925157, 739.051206263795, 1027.3212540764346], [729.4799021090079, 743.245055340723, 1032.2747079279823], [731.5209634255001, 747.4389044176505, 1037.2281617795302], [733.5620247419923, 751.6327534945784, 1042.1816156310779], [735.6030860584847, 755.8266025715061, 1047.1350694826258], [737.6441473749768, 760.0204516484339, 1052.0885233341737], [739.6852086914689, 764.2143007253618, 1057.0419771857216], [741.7262700079613, 768.4081498022895, 1061.9954310372693], [743.7673313244535, 772.6019988792174, 1066.948884888817], [745.8083926409456, 776.7958479561449, 1071.902338740365], [747.849453957438, 780.9896970330728, 1076.8557925919126], [749.8905152739302, 785.1835461100005, 1081.8092464434606], [751.9315765904223, 789.3773951869283, 1086.7627002950082]] \ No newline at end of file diff --git a/standard_transform/datasets.py b/standard_transform/datasets.py index 736dc9b..f0814de 100644 --- a/standard_transform/datasets.py +++ b/standard_transform/datasets.py @@ -4,11 +4,12 @@ import os import warnings -V1DD_STREAMLINE_POINT_FILE = os.path.join( - os.path.dirname(__file__), - 'data', - 'v1dd_um_streamline.json', -) +def _get_data_path(filename): + return os.path.join(os.path.dirname(__file__), 'data', filename) + +V1DD_STREAMLINE_POINT_FILE = _get_data_path('v1dd_um_streamline.json') +MINNIE_STREAMLINE_POINT_FILE = _get_data_path('minnie_um_streamline.json') + MINNIE_VOXEL_RESOLUTION = np.array([4, 4, 40]) V1DD_VOXEL_RESOLUTION = np.array([9, 9, 45]) @@ -87,7 +88,7 @@ def v1dd_streamline_vx(voxel_resolution=V1DD_VOXEL_RESOLUTION): def minnie_streamline_nm(): "Streamline for minnie65 dataset for nm coordinates" return Streamline( - np.array([[0, 0, 0], [0, 1, 0]]), + MINNIE_STREAMLINE_POINT_FILE, tform=minnie_transform_nm(), transform_points=False, ) @@ -95,7 +96,7 @@ def minnie_streamline_nm(): def minnie_streamline_vx(voxel_resolution=MINNIE_VOXEL_RESOLUTION): "Streamline for minnie65 dataset for voxel coordinates" return Streamline( - np.array([[0, 0, 0], [0, 1000, 0]]), + MINNIE_STREAMLINE_POINT_FILE, tform=minnie_transform_vx(voxel_resolution), transform_points=False, ) diff --git a/streamline_generation.ipynb b/streamline_generation.ipynb new file mode 100644 index 0000000..f093de2 --- /dev/null +++ b/streamline_generation.ipynb @@ -0,0 +1,271 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "e2da6653-68b0-4df0-b14b-7870ec3070e2", + "metadata": {}, + "outputs": [], + "source": [ + "from nglui import parser, statebuilder\n", + "import pandas as pd\n", + "import numpy as np\n", + "from scipy import interpolate\n", + "\n", + "from caveclient import CAVEclient" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "ed14f1b3-7c77-4da4-bf8c-76b41277adf5", + "metadata": {}, + "source": [ + "## Generating a streamline\n", + "Building a streamline requires only a few parameters and a neuroglancer state.\n", + "The neuroglancer state should include an annotation layer with linked segmentation ids.\n", + "For several neurons, lay down points every 50 microns or so along the principle pia-to-white matter axis.\n", + "The apical dendrite and primary axon of layer 5 thick tufted cells (or ET cells) is a particularly good case, as are tall layer 6 apical dendrites.\n", + "It's important to have overlapping coverage from several neurons at all depths from layer 2 to white matter.\n", + "Stop placing points when apical tufts bifurcate, as that no longer represents the \"up\" direction for the neuron.\n", + "It is important that the layer use linked segmentation ids, so that the collection of points associated with each neuron can be easily separated.\n", + "\n", + "### Parameters\n", + "* `datastack_name` : Caveclient datastack name.\n", + "* `state_id` : State ID to download the neuroglancer state described above.\n", + "* `streamline_layer_name` : Name of the annotation layer with the streamline points.\n", + "* `y_min`, `y_max` : Top and bottom depths through which the final streamline points should be produced. Typically, a bit above the pial surface to within white matter. The solver will linearly extrapolate beyond the actual data, but this will produce complete coverage and be a useful visual helper. Note that this should be in standard neuroglancer voxel units.\n", + "* `x_ctr`, `z_ctr` : The x, z values to use for the top of the streamline. This should be near the center of the cells you've taken, in case the streamline changes with space in your volume. Note that this should be in standard neuroglancer voxel units.\n", + "* `density`: Density of points along the y-axis. Note that it should be in standard neuroglancer voxel units.\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2101ab0d-70d5-43ba-b694-17ab90eb8840", + "metadata": {}, + "outputs": [], + "source": [ + "datastack_name = 'minnie65_phase3_v1'\n", + "state_id = 5912681645080576\n", + "streamline_layer_name = 'streamline'\n", + "\n", + "# All values below are in neuroglancer voxel coordinates\n", + "y_min = 85_000\n", + "y_max = 280_000\n", + "\n", + "x_ctr = 181000\n", + "z_ctr = 21600\n", + "\n", + "density = 1_000" + ] + }, + { + "cell_type": "markdown", + "id": "c10df21a-4532-4843-a114-080d49057516", + "metadata": {}, + "source": [ + "### Running\n", + "\n", + "After setting parameters in the next cell, run all cells in this section to produce a streamline based on the average vector differences in x and z along the depth axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4e1cf20d-9fe9-48ee-b984-b0b2054ff5a2", + "metadata": {}, + "outputs": [], + "source": [ + "client = CAVEclient(datastack_name)\n", + "\n", + "state = client.state.get_state_json(state_id)\n", + "\n", + "# Read in the neuroglancer state.\n", + "\n", + "anno_df = parser.annotation_dataframe(state)\n", + "sl_df = anno_df.query('layer == @streamline_layer_name').reset_index(drop=True)\n", + "\n", + "group = sl_df['linked_segmentation'].apply(lambda x: x[0])\n", + "points = np.vstack(sl_df['point'].values)\n", + "\n", + "df = pd.DataFrame(\n", + " {\n", + " 'pt_x' : points[:,0],\n", + " 'pt_y' : points[:,1],\n", + " 'pt_z' : points[:,2],\n", + " 'group' : group,\n", + " }\n", + ")\n", + "\n", + "grp_id = np.unique(df['group'])\n", + "grp_remap = {gid: ii for ii, gid in enumerate(grp_id)}\n", + "df['group'] = df['group'].apply(lambda x: grp_remap[x])\n", + "\n", + "# Produce interpolated datapoints based on the real data in order to match depths.\n", + "\n", + "all_new_dx = []\n", + "all_new_y = []\n", + "all_new_dz = []\n", + "all_new_groups = []\n", + "for ii in np.unique(df['group']):\n", + " df_g = df.query('group == @ii').sort_values(by='pt_y')\n", + " fx_g = interpolate.interp1d(df_g['pt_y'], df_g['pt_x'], kind='linear', bounds_error=False)\n", + " fz_g = interpolate.interp1d(df_g['pt_y'], df_g['pt_z'], kind='linear', bounds_error=False)\n", + "\n", + " new_y = np.arange(y_min, y_max, density)\n", + " new_x = fx_g(new_y)\n", + " new_z = fz_g(new_y)\n", + " del_x = np.diff(new_x)\n", + " del_y = np.diff(new_y)\n", + " del_z = np.diff(new_z)\n", + " \n", + " all_new_dx.append(del_x)\n", + " all_new_y.append(new_y[:-1])\n", + " all_new_dz.append(del_z)\n", + " all_new_groups.append([ii]*(len(new_y)-1))\n", + "\n", + "# Average the vector difference at each depth value and then generate a dense path \n", + "\n", + "dfi = pd.DataFrame(\n", + " {\n", + " 'del_x': np.concatenate(all_new_dx),\n", + " 'del_z': np.concatenate(all_new_dz),\n", + " 'pt_y': np.concatenate(all_new_y),\n", + " 'group': np.concatenate(all_new_groups),\n", + " }\n", + ").dropna()\n", + "\n", + "dfi_avg = dfi.groupby('pt_y').mean()\n", + "\n", + "all_pts = np.vstack(\n", + " [x_ctr+np.cumsum(dfi_avg['del_x']),\n", + " dfi_avg.index.values,\n", + " z_ctr+np.cumsum(dfi_avg['del_z']),\n", + " ]).T\n", + "\n", + "\n", + "# Generate a new collection of streamline points with specificty density based on\n", + "# the average trajectory of each interpolation at the center x, z value specified.\n", + "\n", + "fx_all = interpolate.interp1d(\n", + " all_pts[:, 1],\n", + " all_pts[:, 0],\n", + " kind=\"linear\",\n", + " fill_value=\"extrapolate\",\n", + " bounds_error=False,\n", + ")\n", + "\n", + "fz_all = interpolate.interp1d(\n", + " all_pts[:, 1],\n", + " all_pts[:, 2],\n", + " kind=\"linear\",\n", + " fill_value=\"extrapolate\",\n", + " bounds_error=False,\n", + ")\n", + "\n", + "\n", + "new_y = np.arange(y_min, y_max, density)\n", + "new_x = fx_all(new_y)\n", + "new_z = fz_all(new_y)\n", + "new_pts = np.vstack([new_x, new_y, new_z]).T" + ] + }, + { + "cell_type": "markdown", + "id": "b0d166b0-f8e7-4769-99c5-aef5d7b90ade", + "metadata": {}, + "source": [ + "### Sanity checking\n", + "\n", + "After producing your streamline, double check that it actually makes sense with neurons.\n", + "The following will create a neuroglancer link showing the full streamline points.\n", + "Look at the apical dendrites of deep layer cells and the primary axons of cells along cortical depth to make sure this matches expectations." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "69c9b58e-f846-4c11-945b-bfb836ac220c", + "metadata": {}, + "outputs": [], + "source": [ + "img, seg = statebuilder.from_client(client)\n", + "\n", + "ptmap = statebuilder.PointMapper()\n", + "anno = statebuilder.AnnotationLayerConfig(\n", + " \"points\", array_data=True, mapping_rules=ptmap\n", + ")\n", + "\n", + "sb = statebuilder.StateBuilder([img, seg, anno], client=client)\n", + "\n", + "sb.render_state(new_pts, return_as=\"html\")" + ] + }, + { + "cell_type": "markdown", + "id": "e700d4f2-d3cb-4a96-bf03-830218935ffb", + "metadata": {}, + "source": [ + "### Saving a streamline\n", + "\n", + "To generate a useful file for the Streamline class, the most consistent approach is to save it in the expected post-transform space that you will use when interacting with the Streamline class.\n", + "Since we have done everything in voxels, the easiest thing to do is transform by the voxel transform.\n", + "Here, we are in the Minnie65 data so we can use the prebaked transform there.\n", + "In general, however, this might not be an existing function.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5ef3801b-f6cd-45a2-9de4-702992c60bad", + "metadata": {}, + "outputs": [], + "source": [ + "filename = 'minnie_streamline_um.json'\n", + "\n", + "from standard_transform import minnie_transform_vx\n", + "tform = minnie_transform_vx()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ecdc57c6-df21-4d9a-a161-caac5efd4547", + "metadata": {}, + "outputs": [], + "source": [ + "import json\n", + "pts_tform = tform.apply(new_pts)\n", + "\n", + "with open(filename, 'w') as f:\n", + " json.dump(\n", + " pts_tform.tolist(),\n", + " f,\n", + " )" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "analysis_m1", + "language": "python", + "name": "analysis_m1" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}