Skip to content

Commit

Permalink
update head
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Apr 25, 2024
1 parent 034c89f commit bccf01c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 90 deletions.
24 changes: 8 additions & 16 deletions compositionspace/meshes.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,24 @@
# Import libraries
import sys
import os
import pandas as pd
import h5py
import numpy as np
from sklearn.decomposition import PCA
from sklearn.mixture import GaussianMixture
import json
import h5py
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
from tqdm import tqdm
import os

from sklearn.decomposition import PCA
from sklearn.mixture import GaussianMixture
from sklearn.cluster import DBSCAN, KMeans
from sklearn.metrics import silhouette_score, homogeneity_score

from pyevtk.hl import pointsToVTK
from pyevtk.hl import gridToVTK#, pointsToVTKAsTIN
from sklearn.cluster import DBSCAN
from pyevtk.hl import pointsToVTK
from pyevtk.hl import gridToVTK
import trimesh
from sklearn.decomposition import PCA
from sklearn.metrics import silhouette_score
from sklearn.cluster import KMeans
from sklearn.mixture import GaussianMixture
from sklearn.metrics import homogeneity_score
#import plotly.graph_objects as go
import numpy as np
import h5py
from sklearn.decomposition import PCA

from scipy.spatial import Delaunay
from functools import reduce

Expand All @@ -40,6 +31,7 @@ def centeroidnp(data_frame):
sum_y = np.sum(data_frame['y'])
sum_z = np.sum(data_frame['z'])
return sum_x/length, sum_y/length, sum_z/length

def centeroid_df(data_frame):
length = len(data_frame['x'])
sum_x = np.sum(data_frame['x'])
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: compspace
name: iuc09
channels:
- conda-forge
dependencies:
Expand All @@ -17,3 +17,4 @@ dependencies:
- pyvista
- ipywidgets
- panel
- trimesh
85 changes: 39 additions & 46 deletions tests/20230303_Workflow.ipynb

Large diffs are not rendered by default.

31 changes: 5 additions & 26 deletions tests/Mesh_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,16 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "2f1898bf",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/talos/u/gazal/APT_SiGe/CompositionSpaceNFDI/tests\r\n"
]
}
],
"source": [
"MYPREFIX='/u/gazal/APT_SiGe/CompositionSpaceNFDI'\n",
"CWD = os.getcwd()\n",
"sys.path.append(MYPREFIX)\n",
"! echo $PWD"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "f8a46943",
"metadata": {},
"outputs": [],
"source": [
"from compositionspace.datautils import Prepare_data\n",
"from compositionspace.datautils import DataPreparation\n",
"import json \n",
"import pandas as pd\n",
"import matplotlib.pylab as plt\n",
"from compositionspace.segmentation import Composition_clustering\n",
"from compositionspace.postprocessing import Postprocess_data\n",
"from compositionspace.segmentation import CompositionClustering\n",
"from compositionspace.postprocessing import DataPostprocess\n",
"from compositionspace.meshes import *"
]
},
Expand All @@ -68,7 +47,7 @@
"metadata": {},
"outputs": [],
"source": [
"Vox_centroid_file = '/u/gazal/APT_SiGe/output/output_voxels/Output_voxel_cetroids_phases.h5'\n",
"Vox_centroid_file = 'output/output_voxels/Output_voxel_cetroids_phases.h5'\n",
"Vox_ratios = \"/u/gazal/APT_SiGe/output/output_voxels/Output_voxel_composition.h5\"\n",
"Slices_file = '/u/gazal/APT_SiGe/output/output_voxels/Output_big_slices.h5'\n",
"Dbscan_results = \"/u/gazal/APT_SiGe/output/output_voxels/Output_DBSCAN_segmentation_phase_1.h5\""
Expand Down Expand Up @@ -249,7 +228,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion tests/experiment_params.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
input_path: tests/data
input_path: data
output_path: output
n_big_slices: 10
voxel_size: 2
Expand Down

0 comments on commit bccf01c

Please sign in to comment.