{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":45867,"databundleVersionId":6924515,"sourceType":"competition"},{"sourceId":6774400,"sourceType":"datasetVersion","datasetId":3895136},{"sourceId":7071869,"sourceType":"datasetVersion","datasetId":4072692},{"sourceId":7182521,"sourceType":"datasetVersion","datasetId":4151707},{"sourceId":155271035,"sourceType":"kernelVersion"}],"dockerImageVersionId":30626,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Sample a subset of tiles from all images\nSample 48 512x512 images from each image_id. For TMA images, sample 1024x1024 images and scale to 512x512.","metadata":{}},{"cell_type":"code","source":"\nfrom ubc_1_common_tile import (\n    sample_tiles_from_df,\n    get_wsi_image_all_df,\n    get_tma_image_all_df,\n)\nimport os\n\nos.environ['VIPS_DISC_THRESHOLD'] = '25gb'","metadata":{"execution":{"iopub.status.busy":"2023-12-16T15:29:32.638924Z","iopub.execute_input":"2023-12-16T15:29:32.639404Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"tma_df= get_tma_image_all_df()\nsample_tiles_from_df(tma_df, folder=\"/kaggle/working/tma\", sample_n=48, size=1024, scale=0.5)","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"\nwsi_df = get_wsi_image_all_df()\nsample_tiles_from_df(wsi_df, folder=\"/kaggle/working/wsi\", sample_n=48, size=512, scale=1)\n","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}