BodenmillerGroup / ImcSegmentationPipeline

A pixel classification based multiplexed image segmentation pipeline
https://bodenmillergroup.github.io/ImcSegmentationPipeline/
MIT License
84 stars 35 forks source link

Getting AttributeErrors when running section [6] #114

Closed JaydenGittens closed 1 year ago

JaydenGittens commented 1 year ago

image

Dear Bodenmiller Group

I am trying to use the ImcSegmentationPipeline to analyse some IMC data that i have obtained from Hyperion. I am new to GitHub, so i am unsure if the image i have attached has uploaded, but there is an error that i am getting every time i try to run section 6 of the code.

I am also new to coding on Python (i'm used to R), so any help with fixing this error would be greatly appreciated!

Best Jayden

nilseling commented 1 year ago

Hi @JaydenGittens

you would only need to specify your input in the "Specify the inputs" code chunk. The metadata is automatically extracted from the MCD files. Could you please also share screenshots of all other code chunks?

JaydenGittens commented 1 year ago

Hi @nilseling

Thank you so much for replying so quickly!

I have attached screenshots of the other code chunks. I hope that these are visible. If not, i'm happy to fire them over email.

Best Jayden

image image image image image

nilseling commented 1 year ago

Great, thanks! Have all folders been created in H:\Documents\Hyperion pilot analysis\? It seems that you altered the scripts. E.g., the cpout variable is nowhere defined. And what's the output of print(raw_dirs)?

JaydenGittens commented 1 year ago

Yes, they have been. Within the cpout folder there are subfolders for images, masks and probabilities.

The output from print(raw_dirs) is [WindowsPath('M:/Documents/Anne_Hyperion/Experiments Hyperion')]

nilseling commented 1 year ago

Hmm, it's a bit hard to tell what's going on.

I would recommend that you start from scratch:

  1. You clone/download the code from the repository into M:/Documents/Anne_Hyperion/Experiments Hyperion.
  2. In M:/Documents/Anne_Hyperion/Experiments Hyperion you create a raw folder in which you place the panel and the zipped MCD files.
  3. You change the file_regex variable in the imc_preprocessing.ipynb script

Based on this the script should run.

JaydenGittens commented 1 year ago

Thank you Nils!

I have been able to get past that section with the tips you provided.

Although I have encountered this error now that i am trying to export additional metadata. I'm sorry to keep bothering, but I have no idea how to troubleshoot on Python!

Have you any idea what may be the issue in this case?

Best Jayden

image

nilseling commented 1 year ago

In the second chunk, did you replace cellprofiler_input_dir with cpinp? cpinp is not a variable that is defined in the script. As for the first chunk: what's the output of print(final_images_dir)?

JaydenGittens commented 1 year ago

I have now changed cpinpto cellprofiler_input_dir. Because the folder was named as cpinp i thought i had to change the code to match. The second chunk now runs and has created an appropriate folder within the cellprofiler_input_dir folder.

The output of print(final_images_dir) is this: M:\Documents\Hyperion pilot analysis\cpout\images

nilseling commented 1 year ago

Ok, great! In M:\Documents\Hyperion pilot analysis\cpout\images do you see files that end with _full.csv?

JaydenGittens commented 1 year ago

Yes, I do! I have re-run all of the code and believe I have all of the required files now.

Thank you so much Nils!

Best Jayden

nilseling commented 1 year ago

Ok, so there are no more error messages in the script? To be sure you can restart the kernel and re-run the whole script.

JaydenGittens commented 1 year ago

Nope, they have all gone. I will restart the kernel as you have said and re-run :)

nilseling commented 1 year ago

I assume this has been addressed - please reopen if you are still having issues.