{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "633\n"
     ]
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "630\n"
     ]
    }
   ],
   "source": [
    "# Create the file_list.txt file in the specified directory\n",
    "import os \n",
    "import glob\n",
    "\n",
    "files = sorted(glob.glob('max/*'))\n",
    "mask_files = sorted(glob.glob('Cellpose_Segmentation/*'))\n",
    "\n",
    "# append full directory names\n",
    "dir_name = '/mnt/disks/store/'\n",
    "\n",
    "final_files = [dir_name + x for x in files]\n",
    "final_masks = [dir_name + x for x in mask_files]\n",
    "final_files = final_files + final_masks\n",
    "print(len(final_files))\n",
    "for x in final_files:\n",
    "    if not os.path.exists(x):\n",
    "        print('error')\n",
    "        \n",
    "#ff = dir_name + files[0]\n",
    "#print(os.path.exists(ff))\n",
    "\n",
    "with open(os.path.join('./', \"file_list.txt\"), \"w\") as file:\n",
    "    # Write each file name to the file, separated by new lines\n",
    "    for file_name in final_files:\n",
    "        file.write(file_name + \"\\n\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "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.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
